Sayonara Player
Public Member Functions | List of all members
Gui::RatingLabel Class Reference

A simple label, not suitable for editing. For editing, use the RatingEditor class. RatingLabel is intended for the paint method in delegates. More...

#include <RatingLabel.h>

Inheritance diagram for Gui::RatingLabel:

Public Member Functions

 RatingLabel (QWidget *parent, bool enabled=true)
 
void setRating (Rating rating)
 Set a rating from one to 5. More...
 
Rating rating () const
 
Rating ratingAt (QPoint pos) const
 Returns the rating regarding the current mouse position. More...
 
void setVerticalOffset (int offset)
 The y-offset where the stars should be painted. More...
 
void paint (QPainter *painter, const QRect &rect)
 Called from outside. Mostly from delegates or from the RatingEditor class. More...
 
QSize sizeHint () const override
 about 20px in height and 5x20px in width More...
 
QSize minimumSizeHint () const override
 Same as sizeHint. More...
 

Detailed Description

A simple label, not suitable for editing. For editing, use the RatingEditor class. RatingLabel is intended for the paint method in delegates.

Member Function Documentation

◆ minimumSizeHint()

QSize Gui::RatingLabel::minimumSizeHint ( ) const
override

Same as sizeHint.

Returns

◆ paint()

void Gui::RatingLabel::paint ( QPainter *  painter,
const QRect &  rect 
)

Called from outside. Mostly from delegates or from the RatingEditor class.

Parameters
painter
rect

◆ ratingAt()

Rating Gui::RatingLabel::ratingAt ( QPoint  pos) const

Returns the rating regarding the current mouse position.

Parameters
pos
Returns

◆ setRating()

void Gui::RatingLabel::setRating ( Rating  rating)

Set a rating from one to 5.

Parameters
rating

◆ setVerticalOffset()

void Gui::RatingLabel::setVerticalOffset ( int  offset)

The y-offset where the stars should be painted.

Parameters
offset

◆ sizeHint()

QSize Gui::RatingLabel::sizeHint ( ) const
override

about 20px in height and 5x20px in width

Returns