The QPlaceRatings class holds rating information about a place. 更多...
| 頭: | #include <QPlaceRatings> |
| qmake: | QT += location |
| Since: | Qt 5.6 |
| 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 ) |
| bool | operator!= (const QPlaceRatings & other ) const |
| QPlaceRatings & | operator= (const QPlaceRatings & other ) |
| bool | operator== (const QPlaceRatings & other ) const |
The QPlaceRatings class holds rating information about a place.
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";
Constructs a new ratings object.
構造副本為 other .
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.
賦值 other to this ratings object and returns a reference to this ratings object.
返迴 true 若 other is equal to this ratings object, otherwise returns false.