Sayonara Player
Signals | Public Member Functions | Protected Member Functions | List of all members
Gui::RatingEditor Class Reference

This class is used for the actual editing of a RatingLabel While the RatingLabel class is used in paint() methods of delegates, this class is used in normal widgets or for createEditor() methods in delegates. More...

#include <RatingLabel.h>

Inheritance diagram for Gui::RatingEditor:

Signals

void sigFinished (bool save)
 

Public Member Functions

 RatingEditor (QWidget *parent)
 
 RatingEditor (Rating rating, QWidget *parent)
 
void setRating (Rating rating)
 Sets the actual rating. More...
 
Rating rating () const
 Returns the actual rating. This is not neccessarily the rating currently visible. Consider the case where you hover over the stars and lose focus because you are clicking into another widget. You don't want the currently shown value then, you want the old value back. This value is updated when a mouseReleaseEvent is fired when clicking on a star in the current widget. More...
 
void setVerticalOffset (int offset)
 Set an offset where to begin drawing stars. More...
 
void setMouseTrackable (bool b)
 Enable mouse move events. If disabled, there's no live update. More...
 
QSize sizeHint () const override
 Same as RatingLabel::sizeHint. More...
 
QSize minimumSizeHint () const override
 Same as RatingLabel::minimumSizeHint. More...
 

Protected Member Functions

void paintEvent (QPaintEvent *e) override
 
void focusInEvent (QFocusEvent *e) override
 
void focusOutEvent (QFocusEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void mouseMoveEvent (QMouseEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 

Detailed Description

This class is used for the actual editing of a RatingLabel While the RatingLabel class is used in paint() methods of delegates, this class is used in normal widgets or for createEditor() methods in delegates.

Member Function Documentation

◆ minimumSizeHint()

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

Same as RatingLabel::minimumSizeHint.

Returns

◆ rating()

Rating Gui::RatingEditor::rating ( ) const

Returns the actual rating. This is not neccessarily the rating currently visible. Consider the case where you hover over the stars and lose focus because you are clicking into another widget. You don't want the currently shown value then, you want the old value back. This value is updated when a mouseReleaseEvent is fired when clicking on a star in the current widget.

Returns

◆ setMouseTrackable()

void Gui::RatingEditor::setMouseTrackable ( bool  b)

Enable mouse move events. If disabled, there's no live update.

Parameters
b

◆ setRating()

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

Sets the actual rating.

Parameters
rating

◆ setVerticalOffset()

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

Set an offset where to begin drawing stars.

Parameters
offset

◆ sizeHint()

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

Same as RatingLabel::sizeHint.

Returns