a rating widget which displays five stars where the user may select how many are selected
More...
#include <jkqtestarratingwidget.h>
a rating widget which displays five stars where the user may select how many are selected
Screenshot:
Basic usage is simple:
[labRating,starRating] (int r) {
labRating->setText(QString::number(r)+
" / "+QString::number(starRating->
maximum()));
});
You can set the images/icons to be used for present/unpresent stars and the limiter to the left that allows to set rating 0 when clicked:
◆ JKQTEStarRatingWidget()
| JKQTEStarRatingWidget::JKQTEStarRatingWidget |
( |
QWidget * |
parent = NULL | ) |
|
◆ ~JKQTEStarRatingWidget()
| virtual JKQTEStarRatingWidget::~JKQTEStarRatingWidget |
( |
| ) |
|
|
virtual |
◆ darkStarImage()
| QPixmap JKQTEStarRatingWidget::darkStarImage |
( |
| ) |
const |
the pixmap to use for an unselected star
◆ maximum()
| int JKQTEStarRatingWidget::maximum |
( |
| ) |
const |
returns the current maximum rating
◆ mouseReleaseEvent()
| virtual void JKQTEStarRatingWidget::mouseReleaseEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
◆ noStarImage()
| QPixmap JKQTEStarRatingWidget::noStarImage |
( |
| ) |
const |
the pixmap to use for no stars at all (rating() ==0 )
◆ paintEvent()
| virtual void JKQTEStarRatingWidget::paintEvent |
( |
QPaintEvent * |
event | ) |
|
|
protectedvirtual |
◆ rating()
| int JKQTEStarRatingWidget::rating |
( |
| ) |
const |
returns the current rating (between 0 and maximum() )
◆ ratingChanged
| void JKQTEStarRatingWidget::ratingChanged |
( |
int |
rating | ) |
|
|
signal |
signal emitted when the rating changes
◆ setDarkStarImage
| void JKQTEStarRatingWidget::setDarkStarImage |
( |
const QPixmap & |
darkStarImage | ) |
|
|
slot |
sets the pixmap to use for an unselected star
◆ setFrameRect
| void JKQTEStarRatingWidget::setFrameRect |
( |
const QRect & |
| ) |
|
|
slot |
◆ setFrameShadow
| void JKQTEStarRatingWidget::setFrameShadow |
( |
Shadow |
| ) |
|
|
slot |
◆ setFrameShape
| void JKQTEStarRatingWidget::setFrameShape |
( |
Shape |
| ) |
|
|
slot |
◆ setFrameStyle
| void JKQTEStarRatingWidget::setFrameStyle |
( |
int |
| ) |
|
|
slot |
◆ setLineWidth
| void JKQTEStarRatingWidget::setLineWidth |
( |
int |
| ) |
|
|
slot |
◆ setMaximum
| void JKQTEStarRatingWidget::setMaximum |
( |
int |
value | ) |
|
|
slot |
sets the current maximum rating
◆ setMidLineWidth
| void JKQTEStarRatingWidget::setMidLineWidth |
( |
int |
| ) |
|
|
slot |
◆ setNoStarImage
| void JKQTEStarRatingWidget::setNoStarImage |
( |
const QPixmap & |
noStarImage | ) |
|
|
slot |
sets the pixmap to use for no stars at all (rating() ==0 )
◆ setRating
| void JKQTEStarRatingWidget::setRating |
( |
int |
value | ) |
|
|
slot |
sets the current rating (between 0 and maximum() )
◆ setStarImage
| void JKQTEStarRatingWidget::setStarImage |
( |
const QPixmap & |
starImage | ) |
|
|
slot |
sets the pixmap to use for a selected star
◆ setWidgetSizes()
| void JKQTEStarRatingWidget::setWidgetSizes |
( |
| ) |
|
|
protected |
◆ starImage()
| QPixmap JKQTEStarRatingWidget::starImage |
( |
| ) |
const |
the pixmap to use for a selected star
◆ m_darkStarImage
| QPixmap JKQTEStarRatingWidget::m_darkStarImage |
|
protected |
◆ m_maximum
| int JKQTEStarRatingWidget::m_maximum |
|
protected |
◆ m_noStarImage
| QPixmap JKQTEStarRatingWidget::m_noStarImage |
|
protected |
◆ m_rating
| int JKQTEStarRatingWidget::m_rating |
|
protected |
◆ m_starImage
| QPixmap JKQTEStarRatingWidget::m_starImage |
|
protected |
◆ darkStarImage
| QPixmap JKQTEStarRatingWidget::darkStarImage |
|
readwrite |
◆ data
| int JKQTEStarRatingWidget::data |
|
readwrite |
◆ noStarImage
| QPixmap JKQTEStarRatingWidget::noStarImage |
|
readwrite |
◆ rating
| int JKQTEStarRatingWidget::rating |
|
readwrite |
◆ starImage
| QPixmap JKQTEStarRatingWidget::starImage |
|
readwrite |
The documentation for this class was generated from the following file: