The QPlaceRatings class holds rating information about a place. 更多...
头: | #include <QPlaceRatings> |
qmake: | QT += location |
Since: | Qt 5.6 |
该类在 Qt 5.6 引入。
QPlaceRatings (const QPlaceRatings & other ) | |
QPlaceRatings () | |
QPlaceRatings & | operator= (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 ) |
bool | operator!= (const QPlaceRatings & other ) const |
bool | operator== (const QPlaceRatings & other ) const |
Rating information is used to describe how good a place is conceived to be. Typically this information is visualized as a number of stars. The average () function returns an aggregated ratings value out of a possible maximum as given by the maximum () 函数。
qDebug() << QString("This place rated ") + place.ratings().average() + "out of " + place.ratings().maximum() + "stars";
构造副本为 other .
Constructs a new ratings object.
赋值 other to this ratings object and returns a reference to this ratings object.
Destroys the ratings object.
Returns the average value of individual ratings.
另请参阅 setAverage ().
Returns the total number of individual ratings.
另请参阅 setCount ().
Returns true if all fields of the place ratings are 0; otherwise returns false.
Returns the maximum possible rating value.
另请参阅 setMaximum ().
设置 average value of the ratings.
另请参阅 average ().
Sets the total number of individual ratings to count .
另请参阅 count ().
Sets the maximum possible rating value to max .
另请参阅 maximum ().
返回 true 若 other is not equal to this ratings object, otherwise returns false.
返回 true 若 other is equal to this ratings object, otherwise returns false.