From 365059017722b32a3fe9ae7dec38d29944d6704c Mon Sep 17 00:00:00 2001 From: Yulong Bai Date: Wed, 14 Mar 2018 15:06:17 +0100 Subject: QQuickRangeSlider: add touchDragThreshold property Add touchDragThreshold property for configuring the threshold to initiate a 'drag', i.e. touch move, of the handle of the slider. The mouse 'drag' won't be affected by the property. This property may be also used to configure the drag events stealing priorities of nested draggable items in the future. [ChangeLog][RangeSlider] Added touchDragThreshold property for configuring the threshold to initiate the touch 'drag' of the handle of the slider. The mouse 'drag' won't be affected by the property. Task-number: QTBUG-62784 Change-Id: I5555deb827de9d1dc7be00970fba15001105e419 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickrangeslider_p.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/quicktemplates2/qquickrangeslider_p.h') diff --git a/src/quicktemplates2/qquickrangeslider_p.h b/src/quicktemplates2/qquickrangeslider_p.h index 45de6bbb..ae761ed0 100644 --- a/src/quicktemplates2/qquickrangeslider_p.h +++ b/src/quicktemplates2/qquickrangeslider_p.h @@ -70,6 +70,8 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickRangeSlider : public QQuickControl Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION 3) // 2.3 (Qt 5.10) Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION 3) + // 2.5 (Qt 5.12) + Q_PROPERTY(qreal touchDragThreshold READ touchDragThreshold WRITE setTouchDragThreshold RESET resetTouchDragThreshold NOTIFY touchDragThresholdChanged FINAL REVISION 5) public: explicit QQuickRangeSlider(QQuickItem *parent = nullptr); @@ -109,6 +111,11 @@ public: bool isHorizontal() const; bool isVertical() const; + // 2.5 (Qt 5.12) + qreal touchDragThreshold() const; + void setTouchDragThreshold(qreal touchDragThreshold); + void resetTouchDragThreshold(); + Q_SIGNALS: void fromChanged(); void toChanged(); @@ -117,6 +124,8 @@ Q_SIGNALS: void orientationChanged(); // 2.2 (Qt 5.9) Q_REVISION(2) void liveChanged(); + // 2.5 (Qt 5.12) + Q_REVISION(5) void touchDragThresholdChanged(); protected: void focusInEvent(QFocusEvent *event) override; -- cgit v1.2.3