Sur cette page

QPlaceRatings Class

La classe QPlaceRatings contient des informations sur l'évaluation d'un lieu. Plus d'informations...

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

Propriétés

Fonctions publiques

QPlaceRatings()
QPlaceRatings(const 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)

Description détaillée

Les informations d'évaluation sont utilisées pour décrire la qualité d'un lieu. Généralement, ces informations sont visualisées sous la forme d'un nombre d'étoiles. La fonction average() renvoie une valeur d'évaluation agrégée sur un maximum possible donné par la fonction maximum().

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

Documentation sur les propriétés

average : qreal

Cette propriété contient la valeur moyenne des évaluations individuelles.

Fonctions d'accès :

qreal average() const
void setAverage(qreal average)

count : int

Cette propriété contient le nombre total d'évaluations individuelles.

Fonctions d'accès :

int count() const
void setCount(int count)

maximum : qreal

Cette propriété contient la valeur maximale possible de l'évaluation.

Fonctions d'accès :

qreal maximum() const
void setMaximum(qreal max)

Documentation des fonctions membres

QPlaceRatings::QPlaceRatings()

Construit un nouvel objet de notation.

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

Construit une copie de other.

[noexcept] QPlaceRatings::~QPlaceRatings()

Détruit l'objet ratings.

bool QPlaceRatings::isEmpty() const

Retourne vrai si tous les champs de l'évaluation des lieux sont à 0 ; sinon, retourne faux.

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

Attribue other à cet objet de notation et renvoie une référence à cet objet de notation.

Non-membres associés

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

Retourne vrai si lhs n'est pas égal à rhs, sinon retourne faux.

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

Retourne vrai si lhs est égal à rhs, sinon retourne faux.

© 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.