class QPlaceRatings

The QPlaceRatings class holds rating information about a place. More

Synopsis

Properties

  • averageᅟ - The average value of individual ratings

  • countᅟ - The total number of individual ratings

  • maximumᅟ - The maximum possible rating value

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

Warning

This section contains snippets that were automatically translated from C++ to Python and may contain errors.

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() function.

print(QString("This place rated ") + place.ratings().average())
            + "out of " + place.ratings().maximum() + "stars"

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property averageᅟ: float

This property holds the average value of individual ratings..

Access functions:
property countᅟ: int

This property holds the total number of individual ratings..

Access functions:
property maximumᅟ: float

This property holds the maximum possible rating value..

Access functions:
__init__()

Constructs a new ratings object.

__init__(other)
Parameters:

otherQPlaceRatings

Constructs a copy of other.

average()
Return type:

float

See also

setAverage()

Getter of property averageᅟ .

count()
Return type:

int

See also

setCount()

Getter of property countᅟ .

isEmpty()
Return type:

bool

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

maximum()
Return type:

float

See also

setMaximum()

Getter of property maximumᅟ .

__ne__(rhs)
Parameters:

rhsQPlaceRatings

Return type:

bool

Returns true if lhs is not equal to rhs, otherwise returns false.

__eq__(rhs)
Parameters:

rhsQPlaceRatings

Return type:

bool

Returns true if lhs is equal to rhs, otherwise returns false.

setAverage(average)
Parameters:

average – float

See also

average()

Setter of property averageᅟ .

setCount(count)
Parameters:

count – int

See also

count()

Setter of property countᅟ .

setMaximum(max)
Parameters:

max – float

See also

maximum()

Setter of property maximumᅟ .

swap(other)
Parameters:

otherQPlaceRatings