1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the widgets module of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
29
#ifndef QABSTRACTSLIDER_H
30
#define QABSTRACTSLIDER_H
32
#include "QtGui/qwidget.h"
34
class QAbstractSliderPrivate;
36
class Q_GUI_EXPORT QAbstractSlider : public QWidget
40
Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
41
Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
42
Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
43
Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
44
Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
45
Q_PROPERTY(int sliderPosition READ sliderPosition WRITE setSliderPosition NOTIFY sliderMoved)
46
Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
47
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
48
Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance)
49
Q_PROPERTY(bool invertedControls READ invertedControls WRITE setInvertedControls)
50
Q_PROPERTY(bool sliderDown READ isSliderDown WRITE setSliderDown DESIGNABLE false)
53
explicit QAbstractSlider(QWidget *parent=0);
56
Qt::Orientation orientation() const;
64
void setRange(int min, int max);
66
void setSingleStep(int);
67
int singleStep() const;
69
void setPageStep(int);
72
void setTracking(bool enable);
73
bool hasTracking() const;
75
void setSliderDown(bool);
76
bool isSliderDown() const;
78
void setSliderPosition(int);
79
int sliderPosition() const;
81
void setInvertedAppearance(bool);
82
bool invertedAppearance() const;
84
void setInvertedControls(bool);
85
bool invertedControls() const;
100
void triggerAction(SliderAction action);
104
void setOrientation(Qt::Orientation);
107
void valueChanged(int value);
109
void sliderPressed();
110
void sliderMoved(int position);
111
void sliderReleased();
113
void rangeChanged(int min, int max);
115
void actionTriggered(int action);
118
void setRepeatAction(SliderAction action, int thresholdTime = 500, int repeatTime = 50);
119
SliderAction repeatAction() const;
123
SliderOrientationChange,
127
virtual void sliderChange(SliderChange change);
129
void keyPressEvent(QKeyEvent *ev);
130
void timerEvent(QTimerEvent *);
131
void wheelEvent(QWheelEvent *e);
132
void changeEvent(QEvent *e);
136
inline QT3_SUPPORT int minValue() const { return minimum(); }
137
inline QT3_SUPPORT int maxValue() const { return maximum(); }
138
inline QT3_SUPPORT int lineStep() const { return singleStep(); }
139
inline QT3_SUPPORT void setMinValue(int v) { setMinimum(v); }
140
inline QT3_SUPPORT void setMaxValue(int v) { setMaximum(v); }
141
inline QT3_SUPPORT void setLineStep(int v) { setSingleStep(v); }
142
inline QT3_SUPPORT void setSteps(int single, int page) { setSingleStep(single); setPageStep(page); }
143
inline QT3_SUPPORT void addPage() { triggerAction(SliderPageStepAdd); }
144
inline QT3_SUPPORT void subtractPage() { triggerAction(SliderPageStepSub); }
145
inline QT3_SUPPORT void addLine() { triggerAction(SliderSingleStepAdd); }
146
inline QT3_SUPPORT void subtractLine() { triggerAction(SliderSingleStepSub); }
150
QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent=0);
153
Q_DISABLE_COPY(QAbstractSlider)
154
Q_DECLARE_PRIVATE(QAbstractSlider)
157
#endif // QABSTRACTSLIDER_H