#include <KDE/KRatingWidget>
Displays a rating value as a row of pixmaps.
The KRatingWidget displays a range of stars or other arbitrary pixmaps and allows the user to select a certain number by mouse.
- See also
- KRatingPainter
- Author
- Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
Definition at line 40 of file kratingwidget.h.
◆ KRatingWidget()
KRatingWidget::KRatingWidget |
( |
QWidget * |
parent = 0 | ) |
|
◆ ~KRatingWidget()
KRatingWidget::~KRatingWidget |
( |
| ) |
|
◆ alignment()
Qt::Alignment KRatingWidget::alignment |
( |
| ) |
const |
◆ halfStepsEnabled()
bool KRatingWidget::halfStepsEnabled |
( |
| ) |
const |
If half steps are enabled one star equals to 2 rating points and uneven rating values result in half-stars being drawn.
- See also
- setHalfStepsEnabled
Definition at line 148 of file kratingwidget.cpp.
◆ icon()
QIcon KRatingWidget::icon |
( |
| ) |
const |
The icon used to draw a star.
In case a custom pixmap has been set this value is ignored.
- See also
- setIcon, setCustomPixmap
Definition at line 97 of file kratingwidget.cpp.
◆ layoutDirection()
Qt::LayoutDirection KRatingWidget::layoutDirection |
( |
| ) |
const |
The layout direction.
If RTL the stars representing the rating value will be drawn from the right.
- See also
- setLayoutDirection
Definition at line 123 of file kratingwidget.cpp.
◆ leaveEvent()
void KRatingWidget::leaveEvent |
( |
QEvent * |
e | ) |
|
|
protected |
◆ maxRating()
int KRatingWidget::maxRating |
( |
| ) |
const |
◆ mouseMoveEvent()
void KRatingWidget::mouseMoveEvent |
( |
QMouseEvent * |
e | ) |
|
|
protected |
◆ mousePressEvent()
void KRatingWidget::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
protected |
◆ paintEvent()
void KRatingWidget::paintEvent |
( |
QPaintEvent * |
e | ) |
|
|
protected |
◆ rating()
unsigned int KRatingWidget::rating |
( |
| ) |
const |
◆ ratingChanged [1/2]
void KRatingWidget::ratingChanged |
( |
int |
rating | ) |
|
|
signal |
◆ ratingChanged [2/2]
void KRatingWidget::ratingChanged |
( |
unsigned int |
rating | ) |
|
|
signal |
This signal is emitted when the rating is changed.
◆ resizeEvent()
void KRatingWidget::resizeEvent |
( |
QResizeEvent * |
e | ) |
|
|
protected |
◆ setAlignment
void KRatingWidget::setAlignment |
( |
Qt::Alignment |
align | ) |
|
|
slot |
The alignment of the stars in the drawing rect.
All alignment flags are supported.
Definition at line 116 of file kratingwidget.cpp.
◆ setCustomPixmap
void KRatingWidget::setCustomPixmap |
( |
const QPixmap & |
pixmap | ) |
|
|
slot |
◆ setHalfStepsEnabled
void KRatingWidget::setHalfStepsEnabled |
( |
bool |
enabled | ) |
|
|
slot |
If half steps are enabled (the default) then one rating step corresponds to half a star.
Definition at line 189 of file kratingwidget.cpp.
◆ setIcon
void KRatingWidget::setIcon |
( |
const QIcon & |
icon | ) |
|
|
slot |
◆ setLayoutDirection
void KRatingWidget::setLayoutDirection |
( |
Qt::LayoutDirection |
direction | ) |
|
|
slot |
◆ setMaxRating [1/2]
void KRatingWidget::setMaxRating |
( |
int |
max | ) |
|
|
slot |
Set the maximum allowed rating value.
The default is 10 which means that a rating from 1 to 10 is selectable. If max is uneven steps are automatically only allowed full.
Definition at line 182 of file kratingwidget.cpp.
◆ setMaxRating [2/2]
void KRatingWidget::setMaxRating |
( |
unsigned int |
max | ) |
|
|
slot |
◆ setOnlyPaintFullSteps
void KRatingWidget::setOnlyPaintFullSteps |
( |
bool |
fs | ) |
|
|
slot |
◆ setPixmap
void KRatingWidget::setPixmap |
( |
const QPixmap & |
pix | ) |
|
|
slot |
Set the pixap to be used to display a rating step.
By default the "rating" pixmap is loaded.
- Deprecated:
- use setCustomPixmap
Definition at line 63 of file kratingwidget.cpp.
◆ setPixmapSize
void KRatingWidget::setPixmapSize |
( |
int |
size | ) |
|
|
slot |
Set the recommended size of the pixmaps.
This is only used for the sizeHint. The actual size is always dependent on the size of the widget itself.
Definition at line 84 of file kratingwidget.cpp.
◆ setRating [1/2]
void KRatingWidget::setRating |
( |
int |
rating | ) |
|
|
slot |
Set the current rating.
Calling this method will trigger the ratingChanged signal if rating
is different from the previous rating.
Definition at line 162 of file kratingwidget.cpp.
◆ setRating [2/2]
void KRatingWidget::setRating |
( |
unsigned int |
rating | ) |
|
|
slot |
◆ setSpacing
void KRatingWidget::setSpacing |
( |
int |
s | ) |
|
|
slot |
Set the spacing between the pixmaps.
The default is 0.
Definition at line 103 of file kratingwidget.cpp.
◆ sizeHint()
QSize KRatingWidget::sizeHint |
( |
| ) |
const |
◆ spacing()
int KRatingWidget::spacing |
( |
| ) |
const |
The spacing between the rating stars.
- See also
- setSpacing
Definition at line 91 of file kratingwidget.cpp.
◆ alignment
Qt::Alignment KRatingWidget::alignment |
|
readwrite |
◆ halfStepsEnabled
bool KRatingWidget::halfStepsEnabled |
|
readwrite |
◆ icon
QIcon KRatingWidget::icon |
|
readwrite |
◆ maxRating
int KRatingWidget::maxRating |
|
readwrite |
◆ rating
int KRatingWidget::rating |
|
readwrite |
◆ spacing
int KRatingWidget::spacing |
|
readwrite |
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by
doxygen 1.9.6 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.