Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qabstractslider.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QABSTRACTSLIDER_H
5#define QABSTRACTSLIDER_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qwidget.h>
9
10QT_REQUIRE_CONFIG(abstractslider);
11
13
14
16
17class Q_WIDGETS_EXPORT QAbstractSlider : public QWidget
18{
20
21 Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
22 Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
23 Q_PROPERTY(int singleStep READ singleStep WRITE setSingleStep)
24 Q_PROPERTY(int pageStep READ pageStep WRITE setPageStep)
25 Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged USER true)
26 Q_PROPERTY(int sliderPosition READ sliderPosition WRITE setSliderPosition NOTIFY sliderMoved)
27 Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
28 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
29 Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance)
30 Q_PROPERTY(bool invertedControls READ invertedControls WRITE setInvertedControls)
31 Q_PROPERTY(bool sliderDown READ isSliderDown WRITE setSliderDown DESIGNABLE false)
32
33public:
34 explicit QAbstractSlider(QWidget *parent = nullptr);
36
37 Qt::Orientation orientation() const;
38
39 void setMinimum(int);
40 int minimum() const;
41
42 void setMaximum(int);
43 int maximum() const;
44
45 void setSingleStep(int);
46 int singleStep() const;
47
48 void setPageStep(int);
49 int pageStep() const;
50
51 void setTracking(bool enable);
52 bool hasTracking() const;
53
54 void setSliderDown(bool);
55 bool isSliderDown() const;
56
57 void setSliderPosition(int);
58 int sliderPosition() const;
59
60 void setInvertedAppearance(bool);
61 bool invertedAppearance() const;
62
63 void setInvertedControls(bool);
64 bool invertedControls() const;
65
76
77 int value() const;
78
79 void triggerAction(SliderAction action);
80
81public Q_SLOTS:
82 void setValue(int);
83 void setOrientation(Qt::Orientation);
84 void setRange(int min, int max);
85
88
92
93 void rangeChanged(int min, int max);
94
95 void actionTriggered(int action);
96
97protected:
98 bool event(QEvent *e) override;
99
100 void setRepeatAction(SliderAction action, int thresholdTime = 500, int repeatTime = 50);
101 SliderAction repeatAction() const;
102
109 virtual void sliderChange(SliderChange change);
110
111 void keyPressEvent(QKeyEvent *ev) override;
112 void timerEvent(QTimerEvent *) override;
113#if QT_CONFIG(wheelevent)
114 void wheelEvent(QWheelEvent *e) override;
115#endif
116 void changeEvent(QEvent *e) override;
117
118
119protected:
120 QAbstractSlider(QAbstractSliderPrivate &dd, QWidget *parent = nullptr);
121
122private:
123 Q_DISABLE_COPY(QAbstractSlider)
124 Q_DECLARE_PRIVATE(QAbstractSlider)
125};
126
128
129#endif // QABSTRACTSLIDER_H
The QAbstractSlider class provides an integer value within a range.
void sliderPressed()
This signal is emitted when the user presses the slider with the mouse, or programmatically when setS...
void sliderReleased()
This signal is emitted when the user releases the slider with the mouse, or programmatically when set...
void valueChanged(int value)
This signal is emitted when the slider value has changed, with the new slider value as argument.
SliderAction
\value SliderNoAction \value SliderSingleStepAdd \value SliderSingleStepSub \value SliderPageStepAdd ...
void actionTriggered(int action)
This signal is emitted when the slider action action is triggered.
void sliderMoved(int position)
This signal is emitted when sliderDown is true and the slider moves.
SliderChange
\value SliderRangeChange \value SliderOrientationChange \value SliderStepsChange \value SliderValueCh...
void rangeChanged(int min, int max)
This signal is emitted when the slider range has changed, with min being the new minimum,...
\inmodule QtCore
Definition qcoreevent.h:45
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore
Definition qcoreevent.h:366
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
Combined button and popup list for selecting options.
Definition qcompare.h:63
Orientation
Definition qnamespace.h:98
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean enable
struct _cl_event * event
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
#define explicit
settings setValue("DataPump/bgcolor", color)
progressBar setRange(0, 100)
setMaximum(maximum)
setMinimum(minimum)
[2]