Qt Reference Documentation

QML RatingIndicator Element

Indicates users' rating value. More...

This element was introduced in Qt Quick Components 1.0.

Properties

Detailed Description

A RatingIndicator is a component that shows the user's rating value within the maximum allowed range that you have specified. Optionally, you can also specify the count value that will be displayed next to the images. The screenshot below shows an example of a RatingIndicator.

Note: When count is used, the height of the RatingIndicator is different than when the count is not used. This is due to the font size being larger than the image size.

Showing a RatingIndicator

The code snippet below illustrates how to create a RatingIndicator.

 // Rating indicator with vote count
 RatingIndicator {
     ratingValue: 3
     maximumValue: 5
     count: 3
 }

 // Rating indicator without vote count
 RatingIndicator {
     maximumValue: 5
     ratingValue: 3
 }

Property Documentation

count : int

A number shown next to rating images. It is normally used for indicating the number of votes cast. It is displayed only if the number is greater or equal to 0. The default value is -1.


maximumValue : double

The maximum rating. The number should be greater or equal to 0. The default value is 0.


platformInverted : bool

Symbian:

If platformInverted is true, the component is visualized with the inverted style. For more information, see Using Inverted Style with Symbian Components. By default platformInverted is false.

This property group was introduced in Qt Quick Components 1.1.


ratingValue : double

The rating value. The number should be greater or equal to 0. The default value is 0.