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 : 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)
通过Move构造一个QPlaceRatings 的实例。
[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.