28 Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged FINAL)
29 Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged FINAL)
30 Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY valueChanged FINAL)
31 Q_PROPERTY(qreal position READ position NOTIFY positionChanged FINAL)
32 Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL)
33 Q_PROPERTY(qreal stepSize READ stepSize WRITE setStepSize NOTIFY stepSizeChanged FINAL)
34 Q_PROPERTY(SnapMode snapMode READ snapMode WRITE setSnapMode NOTIFY snapModeChanged FINAL)
35 Q_PROPERTY(
bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL)
36 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL)
37 Q_PROPERTY(QQuickItem *handle READ handle WRITE setHandle NOTIFY handleChanged FINAL)
38 Q_PROPERTY(
bool live READ live WRITE setLive NOTIFY liveChanged FINAL REVISION(2, 2))
40 Q_PROPERTY(
bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3))
41 Q_PROPERTY(
bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3))
43 Q_PROPERTY(qreal touchDragThreshold READ touchDragThreshold WRITE setTouchDragThreshold RESET resetTouchDragThreshold NOTIFY touchDragThresholdChanged FINAL REVISION(2, 5))
44 Q_PROPERTY(qreal implicitHandleWidth READ implicitHandleWidth NOTIFY implicitHandleWidthChanged FINAL REVISION(2, 5))
45 Q_PROPERTY(qreal implicitHandleHeight READ implicitHandleHeight NOTIFY implicitHandleHeightChanged FINAL REVISION(2, 5))
46 Q_CLASSINFO(
"DeferredPropertyNames",
"background,handle")
47 QML_NAMED_ELEMENT(Slider)
48 QML_ADDED_IN_VERSION(2, 0)
51 explicit QQuickSlider(QQuickItem *parent =
nullptr);
55 void setFrom(qreal from);
61 void setValue(qreal value);
63 qreal position()
const;
64 qreal visualPosition()
const;
66 qreal stepSize()
const;
67 void setStepSize(qreal step);
76 SnapMode snapMode()
const;
77 void setSnapMode(SnapMode mode);
79 bool isPressed()
const;
80 void setPressed(
bool pressed);
82 Qt::Orientation orientation()
const;
83 void setOrientation(Qt::Orientation orientation);
85 QQuickItem *handle()
const;
86 void setHandle(QQuickItem *handle);
89 Q_REVISION(2, 1) Q_INVOKABLE qreal valueAt(qreal position)
const;
93 void setLive(
bool live);
96 bool isHorizontal()
const;
97 bool isVertical()
const;
100 qreal touchDragThreshold()
const;
101 void setTouchDragThreshold(qreal touchDragThreshold);
102 void resetTouchDragThreshold();
104 qreal implicitHandleWidth()
const;
105 qreal implicitHandleHeight()
const;
115 void positionChanged();
116 void visualPositionChanged();
117 void stepSizeChanged();
118 void snapModeChanged();
119 void pressedChanged();
120 void orientationChanged();
121 void handleChanged();
123 Q_REVISION(2, 2)
void moved();
124 Q_REVISION(2, 2)
void liveChanged();
126 Q_REVISION(2, 5)
void touchDragThresholdChanged();
127 Q_REVISION(2, 5)
void implicitHandleWidthChanged();
128 Q_REVISION(2, 5)
void implicitHandleHeightChanged();
131 void keyPressEvent(QKeyEvent *event) override;
132 void keyReleaseEvent(QKeyEvent *event) override;
133 void mousePressEvent(QMouseEvent *event) override;
134#if QT_CONFIG(quicktemplates2_multitouch)
135 void touchEvent(QTouchEvent *event) override;
137#if QT_CONFIG(wheelevent)
138 void wheelEvent(QWheelEvent *event) override;
141 void mirrorChange() override;
142 void componentComplete() override;
144#if QT_CONFIG(accessibility)
145 void accessibilityActiveChanged(
bool active) override;
146 QAccessible::Role accessibleRole()
const override;
150 Q_DISABLE_COPY(QQuickSlider)
151 Q_DECLARE_PRIVATE(QQuickSlider)