Plasma
slider.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PLASMA_SLIDER_H
00021 #define PLASMA_SLIDER_H
00022
00023 #include <QtGui/QGraphicsProxyWidget>
00024
00025 #include <plasma/plasma_export.h>
00026
00027 class QSlider;
00028
00029 namespace Plasma
00030 {
00031
00032 class SliderPrivate;
00033
00039 class PLASMA_EXPORT Slider : public QGraphicsProxyWidget
00040 {
00041 Q_OBJECT
00042
00043 Q_PROPERTY(QGraphicsWidget *parentWidget READ parentWidget)
00044 Q_PROPERTY(int maximum READ maximum WRITE setMinimum)
00045 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
00046 Q_PROPERTY(int value READ value WRITE setValue)
00047 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
00048 Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
00049 Q_PROPERTY(QSlider *nativeWidget READ nativeWidget)
00050
00051 public:
00052 explicit Slider(QGraphicsWidget *parent = 0);
00053 ~Slider();
00054
00058 int maximum() const;
00059
00063 int minimum() const;
00064
00068 int value() const;
00069
00073 Qt::Orientation orientation() const;
00074
00080 void setStyleSheet(const QString &stylesheet);
00081
00085 QString styleSheet();
00086
00090 QSlider *nativeWidget() const;
00091
00092 protected:
00093 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00094 void wheelEvent(QGraphicsSceneWheelEvent *event);
00095
00096 public Q_SLOTS:
00100 void setMaximum(int maximum);
00101
00105 void setMinimum(int minimum);
00106
00110 void setRange(int minimum, int maximum);
00111
00118 void setValue(int value);
00119
00123 void setOrientation(Qt::Orientation orientation);
00124
00125 Q_SIGNALS:
00133 void sliderMoved(int value);
00134
00139 void valueChanged(int value);
00140
00141 private:
00142 SliderPrivate * const d;
00143 };
00144
00145 }
00146
00147 #endif // multiple inclusion guard