QPlaceRatings Class

The QPlaceRatings class holds rating information about a place. 更多...

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

特性

公共函數

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 )
QPlaceRatings & operator= (const QPlaceRatings & other )
bool operator!= (const QPlaceRatings & lhs , const QPlaceRatings & rhs )
bool operator== (const QPlaceRatings & lhs , const QPlaceRatings & rhs )

詳細描述

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";
					

特性文檔編製

average : qreal

This property holds the average value of individual ratings.

訪問函數:

qreal average () const
void setAverage (qreal average )

count : int

This property holds the total number of individual ratings.

訪問函數:

int count () const
void setCount (int count )

maximum : qreal

This property holds the maximum possible rating value.

訪問函數:

qreal maximum () const
void setMaximum (qreal max )

成員函數文檔編製

QPlaceRatings:: QPlaceRatings ()

Constructs a new ratings object.

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

構造副本為 other .

[noexcept] QPlaceRatings:: ~QPlaceRatings ()

Destroys the ratings object.

bool QPlaceRatings:: isEmpty () const

Returns true if all fields of the place ratings are 0; otherwise returns false.

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

賦值 other to this ratings object and returns a reference to this ratings object.

相關非成員

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

返迴 true 若 lhs 不等於 rhs ,否則返迴 false。

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

返迴 true 若 lhs 等於 rhs ,否則返迴 false。