Plasma
slider.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2008 Aaron Seigo <aseigo@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 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 NOTIFY valueChanged) 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 } // namespace Plasma 00146 00147 #endif // multiple inclusion guard
KDE 4.6 API Reference