このページでは

QPlaceRatings Class

QPlaceRatings クラスは、場所に関する評価情報を保持します。詳細...

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

プロパティ

公開関数

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)

詳細な説明

評価情報は、ある場所がどれほど優れていると見なされているかを表すために使用されます。通常、この情報は星の数として視覚化されます。average() 関数は、maximum() 関数によって与えられる最大値に対する集計された評価値を返します。

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

プロパティのドキュメント

average : qreal

このプロパティには、個々の評価の平均値が格納されます。

アクセス関数:

qreal average() const
void setAverage(qreal average)

count : int

このプロパティには、個々の評価の総数が格納されます。

アクセス関数:

int count() const
void setCount(int count)

maximum : qreal

このプロパティは、可能な最大評価値を保持します。

アクセス関数:

qreal maximum() const
void setMaximum(qreal max)

メンバ関数のドキュメント

QPlaceRatings::QPlaceRatings()

新しい評価オブジェクトを作成します。

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

other のコピーを作成します。

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

QPlaceRatings のインスタンスをMoveコンストラクタで生成します。

[noexcept] QPlaceRatings::~QPlaceRatings()

ratings オブジェクトを破棄します。

bool QPlaceRatings::isEmpty() const

場所の評価のすべてのフィールドが 0 の場合、true を返します。それ以外の場合は false を返します。

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

この評価オブジェクトに `other ` を割り当て、この評価オブジェクトへの参照を返します。

関連する非メンバー

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

lhs がrhs と等しくない場合は true を返し、そうでない場合は false を返します。

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

lhs がrhs と等しい場合は true を返し、そうでない場合は 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.