• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
kratingwidget.h
Go to the documentation of this file.
1/*
2 * This file is part of the Nepomuk KDE project.
3 * Copyright (C) 2006-2007 Sebastian Trueg <trueg@kde.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef KRATINGWIDGET_H
22#define KRATINGWIDGET_H
23
24#include <QtGui/QFrame>
25
26#include <kdeui_export.h>
27
40class KDEUI_EXPORT KRatingWidget : public QFrame
41{
42 Q_OBJECT
43 Q_PROPERTY( int rating READ rating WRITE setRating )
44 Q_PROPERTY( int maxRating READ maxRating WRITE setMaxRating )
45 Q_PROPERTY( Qt::Alignment alignment READ alignment WRITE setAlignment )
46 Q_PROPERTY( bool halfStepsEnabled READ halfStepsEnabled WRITE setHalfStepsEnabled )
47 Q_PROPERTY( int spacing READ spacing WRITE setSpacing )
48 Q_PROPERTY( QIcon icon READ icon WRITE setIcon )
49
50 public:
54 KRatingWidget( QWidget* parent = 0 );
55
59 ~KRatingWidget();
60
64 unsigned int rating() const;
65
69 int maxRating() const;
70
76 Qt::Alignment alignment() const;
77
85 Qt::LayoutDirection layoutDirection() const;
86
92 int spacing() const;
93
94 QSize sizeHint() const;
95
103 bool halfStepsEnabled() const;
104
111 QIcon icon() const;
112
113 Q_SIGNALS:
117 void ratingChanged( unsigned int rating );
118 void ratingChanged( int rating );
119
120 public Q_SLOTS:
125 void setRating( int rating );
126
130#ifndef KDE_NO_DEPRECATED
131 KDE_DEPRECATED void setRating( unsigned int rating );
132#endif
133
139 void setMaxRating( int max );
140
144#ifndef KDE_NO_DEPRECATED
145 KDE_DEPRECATED void setMaxRating( unsigned int max );
146#endif
147
152 void setHalfStepsEnabled( bool enabled );
153
157#ifndef KDE_NO_DEPRECATED
158 KDE_DEPRECATED void setOnlyPaintFullSteps( bool );
159#endif
160
164 void setSpacing( int );
165
170 void setAlignment( Qt::Alignment align );
171
175 void setLayoutDirection( Qt::LayoutDirection direction );
176
180 void setIcon( const QIcon& icon );
181
185 void setCustomPixmap( const QPixmap& pixmap );
186
193#ifndef KDE_NO_DEPRECATED
194 KDE_DEPRECATED void setPixmap( const QPixmap& );
195#endif
196
202 void setPixmapSize( int size );
203
204 protected:
205 void mousePressEvent( QMouseEvent* e );
206 void mouseMoveEvent( QMouseEvent* e );
207 void leaveEvent( QEvent* e );
208 void paintEvent( QPaintEvent* e );
209 void resizeEvent( QResizeEvent* e );
210
211 private:
212 class Private;
213 Private* const d;
214};
215
216#endif
KRatingWidget
Displays a rating value as a row of pixmaps.
Definition: kratingwidget.h:41
KRatingWidget::ratingChanged
void ratingChanged(unsigned int rating)
This signal is emitted when the rating is changed.
KRatingWidget::ratingChanged
void ratingChanged(int rating)
QFrame
QWidget
kdeui_export.h
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.

KDEUI

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal