Auf dieser Seite

QPlaceRatings Class

Die Klasse „QPlaceRatings“ enthält Bewertungsinformationen zu einem Ort. Mehr...

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

Eigenschaften

Öffentliche Veranstaltungen

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)

Detaillierte Beschreibung

Bewertungsinformationen dienen dazu, zu beschreiben, wie gut ein Ort eingeschätzt wird. In der Regel werden diese Informationen als Anzahl von Sternen dargestellt. Die Funktion „ average()“ gibt einen aggregierten Bewertungswert auf einer Skala bis zum maximalen Gesamtwert zurück, der von der Funktion „ maximum()“ bereitgestellt wird.

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

Dokumentation der Eigenschaft

average : qreal

Diese Eigenschaft enthält den Durchschnittswert der einzelnen Bewertungen.

Zugriffsfunktionen:

qreal average() const
void setAverage(qreal average)

count : int

Diese Eigenschaft enthält die Gesamtzahl der einzelnen Bewertungen.

Zugriffsfunktionen:

int count() const
void setCount(int count)

maximum : qreal

Diese Eigenschaft enthält den höchstmöglichen Bewertungswert.

Zugriffsfunktionen:

qreal maximum() const
void setMaximum(qreal max)

Dokumentation der Member-Funktionen

QPlaceRatings::QPlaceRatings()

Erstellt ein neues Bewertungsobjekt.

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

Erstellt eine Kopie von „ other “.

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

Erstellt eine Instanz von ` QPlaceRatings` mithilfe von `Move`.

[noexcept] QPlaceRatings::~QPlaceRatings()

Löscht das Bewertungsobjekt.

bool QPlaceRatings::isEmpty() const

Gibt „true“ zurück, wenn alle Felder der Ortsbewertungen den Wert 0 haben; andernfalls wird „false“ zurückgegeben.

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

Weist diesem Bewertungsobjekt „ other “ zu und gibt eine Referenz auf dieses Bewertungsobjekt zurück.

Verwandte Nicht-Mitglieder

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

Gibt „true“ zurück, wenn lhs nicht gleich rhs ist; andernfalls wird „false“ zurückgegeben.

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

Gibt „true“ zurück, wenn „ lhs “ gleich „ rhs “ ist, andernfalls „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.