In questa pagina

QPlaceRatings Class

La classe QPlaceRatings contiene le informazioni relative alle valutazioni di un luogo. Per saperne di più...

Header: #include <QPlaceRatings>
qmake: QT += location

Proprietà

Funzioni pubbliche

QPlaceRatings()
QPlaceRatings(const QPlaceRatings &other)
QPlaceRatings(QPlaceRatings &&other)
~QPlaceRatings()
qreal average() const
int count() const
bool isEmpty() const
qreal maximum() const
void setAverage(qreal average)
void setCount(int count)
void setMaximum(qreal max)
QPlaceRatings &operator=(const QPlaceRatings &other)
bool operator!=(const QPlaceRatings &lhs, const QPlaceRatings &rhs)
bool operator==(const QPlaceRatings &lhs, const QPlaceRatings &rhs)

Descrizione dettagliata

Le informazioni relative alle valutazioni vengono utilizzate per descrivere quanto un luogo sia considerato valido. In genere queste informazioni vengono visualizzate sotto forma di un numero di stelle. La funzione average() restituisce un valore aggregato delle valutazioni su un massimo possibile, come specificato dalla funzione maximum().

qDebug() << QString("This place rated ") + place.ratings().average()
            + "out of " + place.ratings().maximum() + "stars";

Documentazione delle proprietà

average : qreal

Questa proprietà contiene il valore medio delle singole valutazioni.

Funzioni di accesso:

qreal average() const
void setAverage(qreal average)

count : int

Questa proprietà contiene il numero totale delle valutazioni individuali.

Funzioni di accesso:

int count() const
void setCount(int count)

maximum : qreal

Questa proprietà contiene il valore massimo possibile della classificazione.

Funzioni di accesso:

qreal maximum() const
void setMaximum(qreal max)

Documentazione sulle funzioni membro

QPlaceRatings::QPlaceRatings()

Crea un nuovo oggetto "ratings".

[noexcept] QPlaceRatings::QPlaceRatings(const QPlaceRatings &other)

Crea una copia di other.

[constexpr noexcept default] QPlaceRatings::QPlaceRatings(QPlaceRatings &&other)

Crea un'istanza di ` QPlaceRatings`.

[noexcept] QPlaceRatings::~QPlaceRatings()

Elimina l'oggetto "ratings".

bool QPlaceRatings::isEmpty() const

Restituisce true se tutti i campi delle valutazioni del luogo sono pari a 0; in caso contrario, restituisce false.

[noexcept] QPlaceRatings &QPlaceRatings::operator=(const QPlaceRatings &other)

Assegna “ other ” a questo oggetto “ratings” e restituisce un riferimento a tale oggetto.

Elementi non membri correlati

[noexcept] bool operator!=(const QPlaceRatings &lhs, const QPlaceRatings &rhs)

Restituisce true se lhs non è uguale a rhs, altrimenti restituisce false.

[noexcept] bool operator==(const QPlaceRatings &lhs, const QPlaceRatings &rhs)

Restituisce true se lhs è uguale a rhs, altrimenti restituisce false.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.