• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Nepomuk

KRatingWidget Class Reference

#include <kratingwidget.h>

Inheritance diagram for KRatingWidget:

Inheritance graph
[legend]

List of all members.


Detailed Description

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@kde.org>

Definition at line 38 of file kratingwidget.h.


Public Slots

void setAlignment (Qt::Alignment align)
void setCustomPixmap (const QPixmap &pixmap)
void setHalfStepsEnabled (bool enabled)
void setIcon (const QIcon &icon)
void setLayoutDirection (Qt::LayoutDirection direction)
void setMaxRating (unsigned int max)
void setMaxRating (int max)
void setOnlyPaintFullSteps (bool)
void setPixmap (const QPixmap &)
void setPixmapSize (int size)
void setRating (unsigned int rating)
void setRating (int rating)
void setSpacing (int)

Signals

void ratingChanged (int rating)
void ratingChanged (unsigned int rating)

Public Member Functions

Qt::Alignment alignment () const
bool halfStepsEnabled () const
QIcon icon () const
 KRatingWidget (QWidget *parent=0)
Qt::LayoutDirection layoutDirection () const
int maxRating () const
unsigned int rating () const
QSize sizeHint () const
int spacing () const
 ~KRatingWidget ()

Protected Member Functions

void leaveEvent (QEvent *e)
void mouseMoveEvent (QMouseEvent *e)
void mousePressEvent (QMouseEvent *e)
void paintEvent (QPaintEvent *e)
void resizeEvent (QResizeEvent *e)

Constructor & Destructor Documentation

KRatingWidget::KRatingWidget ( QWidget *  parent = 0  ) 

Creates a new rating widget.

KRatingWidget::~KRatingWidget (  ) 

Destructor.


Member Function Documentation

Qt::Alignment KRatingWidget::alignment (  )  const

The alignment of the stars.

See also:
setAlignment

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

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

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

void KRatingWidget::leaveEvent ( QEvent *  e  )  [protected]

int KRatingWidget::maxRating (  )  const

Returns:
the maximum possible rating.

void KRatingWidget::mouseMoveEvent ( QMouseEvent *  e  )  [protected]

void KRatingWidget::mousePressEvent ( QMouseEvent *  e  )  [protected]

void KRatingWidget::paintEvent ( QPaintEvent *  e  )  [protected]

unsigned int KRatingWidget::rating (  )  const

Returns:
The current rating.

void KRatingWidget::ratingChanged ( int  rating  )  [signal]

void KRatingWidget::ratingChanged ( unsigned int  rating  )  [signal]

Emitted if the rating is changed by user interaction (ie.

mouse click). A call to setRating does not trigger this signal.

void KRatingWidget::resizeEvent ( QResizeEvent *  e  )  [protected]

void KRatingWidget::setAlignment ( Qt::Alignment  align  )  [slot]

The alignment of the stars in the drawing rect.

All alignment flags are supported.

void KRatingWidget::setCustomPixmap ( const QPixmap &  pixmap  )  [slot]

Set a custom pixmap.

void KRatingWidget::setHalfStepsEnabled ( bool  enabled  )  [slot]

If half steps are enabled (the default) then one rating step corresponds to half a star.

void KRatingWidget::setIcon ( const QIcon &  icon  )  [slot]

Set a custom icon.

Defaults to "rating".

void KRatingWidget::setLayoutDirection ( Qt::LayoutDirection  direction  )  [slot]

LTR or RTL.

void KRatingWidget::setMaxRating ( unsigned int  max  )  [slot]

Deprecated:
use setMaxRating( int max )

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.

void KRatingWidget::setOnlyPaintFullSteps ( bool   )  [slot]

Deprecated:
Use setHalfStepsEnabled

void KRatingWidget::setPixmap ( const QPixmap &   )  [slot]

Set the pixap to be used to display a rating step.

By default the "rating" pixmap is loaded.

Deprecated:
use setCustomPixmap

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 dependant on the size of the widget itself.

void KRatingWidget::setRating ( unsigned int  rating  )  [slot]

Deprecated:
use setRating( int max )

void KRatingWidget::setRating ( int  rating  )  [slot]

Set the current rating.

Calling this method will NOT trigger the ratingChanged signal.

void KRatingWidget::setSpacing ( int   )  [slot]

Set the spacing between the pixmaps.

The default is 0.

QSize KRatingWidget::sizeHint (  )  const

int KRatingWidget::spacing (  )  const

The spacing between the rating stars.

See also:
setSpacing


The documentation for this class was generated from the following file:
  • kratingwidget.h

Nepomuk

Skip menu "Nepomuk"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal