KDEUI
kratingpainter.cpp
Go to the documentation of this file.
183 void KRatingPainter::paint( QPainter* painter, const QRect& rect, int rating, int hoverRating ) const
203 QPixmap disabledRatingPix = iconEffect->apply( ratingPix, KIconEffect::ToGray, 1.0, QColor(), QColor(), false );
259 d->direction == Qt::RightToLeft ? ( numHoverStars > 0 ? hoverPix : disabledRatingPix ) : ratingPix,
262 d->direction == Qt::RightToLeft ? ratingPix : ( numHoverStars > 0 ? hoverPix : disabledRatingPix ),
343 void KRatingPainter::paintRating( QPainter* painter, const QRect& rect, Qt::Alignment align, int rating, int hoverRating )
352 int KRatingPainter::getRatingFromPosition( const QRect& rect, Qt::Alignment align, Qt::LayoutDirection direction, const QPoint& pos )
static void paintRating(QPainter *p, const QRect &rect, Qt::Alignment align, int rating, int hoverRating=-1)
Convenience method that paints a rating into the given rect.
Definition: kratingpainter.cpp:343
void setSpacing(int spacing)
Set the spacing between rating pixmaps.
Definition: kratingpainter.cpp:177
Qt::LayoutDirection layoutDirection() const
The layout direction.
Definition: kratingpainter.cpp:105
int width() const
static void semiTransparent(QImage &image)
Renders an image semi-transparent.
Definition: kiconeffect.cpp:527
int right() const
static KIconLoader * global()
Returns the global icon loader initialized with the global KComponentData.
int ratingFromPosition(const QRect &rect, const QPoint &pos) const
Calculate the rating value from mouse position pos.
Definition: kratingpainter.cpp:288
int height() const
int x() const
int y() const
typedef Alignment
Qt::LayoutDirection layoutDirection() const
int x() const
void setAlignment(Qt::Alignment align)
The alignment of the stars in the drawing rect.
Definition: kratingpainter.cpp:147
int top() const
int left() const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
void setHalfStepsEnabled(bool enabled)
If half steps are enabled (the default) then one rating step corresponds to half a star...
Definition: kratingpainter.cpp:141
bool isEnabled() const
The rating can be painted in a disabled state where no color is used and hover ratings are ignored...
Definition: kratingpainter.cpp:117
Utility class that draws a row of stars for a rating value.
Definition: kratingpainter.h:50
bool halfStepsEnabled() const
If half steps are enabled one star equals to 2 rating points and uneven rating values result in half-...
Definition: kratingpainter.cpp:93
QPixmap scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const
QPixmap customPixmap() const
The custom pixmap set to draw a star.
Definition: kratingpainter.cpp:123
KIconEffect * iconEffect() const
Returns a pointer to the KIconEffect object used by the icon loader.
Definition: kiconloader.cpp:1487
int height() const
static int getRatingFromPosition(const QRect &rect, Qt::Alignment align, Qt::LayoutDirection direction, const QPoint &pos)
Get the rating that would be selected if the user clicked position pos within rect if the rating has ...
Definition: kratingpainter.cpp:352
void setLayoutDirection(Qt::LayoutDirection direction)
LTR or RTL.
Definition: kratingpainter.cpp:153
void paint(QPainter *painter, const QRect &rect, int rating, int hoverRating=-1) const
Draw the rating.
Definition: kratingpainter.cpp:183
int width() const
int bottom() const
QImage apply(const QImage &src, int group, int state) const
Applies an effect to an image.
Definition: kiconeffect.cpp:196
Definition: kiconeffect.h:72
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.