aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickdrag_p.h
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-08-22 17:20:52 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-13 17:51:48 +0200
commit406d6d33a6c0c5f99dfa31e2eb681b1fefcd5fe0 (patch)
treec365e466a5ba74a29ab1bc1f51aab6f407d105b9 /src/quick/items/qquickdrag_p.h
parentee6cc22ebd0ec236454bc2112fe5f82e31299143 (diff)
Expose drag threshold in MouseArea
In several cases such as for creating a Slider, it is useful to have a 0 pixel threshold in order to initiate a drag operation. We have previously hardcoded this to a platform dependent (usually 10 pixel) value for MouseArea. Note that we have no way of indicating the version/revision number in a grouped property for documentation at the moment. In addition we deliberately had to remove the REVISION from the property because it is blocked by QTBUG-33179. However, since this is not a user-creatable type it should not cause any issues in practice. This patch adds MouseArea.drag.threshold in order to improve on this. Change-Id: Ia4871e64fab39e30c4494f00be99ad38cdd630df Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/quick/items/qquickdrag_p.h')
-rw-r--r--src/quick/items/qquickdrag_p.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h
index 098fcc61b9..22829350fe 100644
--- a/src/quick/items/qquickdrag_p.h
+++ b/src/quick/items/qquickdrag_p.h
@@ -157,6 +157,9 @@ class Q_AUTOTEST_EXPORT QQuickDrag : public QObject
Q_PROPERTY(qreal maximumY READ ymax WRITE setYmax NOTIFY maximumYChanged)
Q_PROPERTY(bool active READ active NOTIFY activeChanged)
Q_PROPERTY(bool filterChildren READ filterChildren WRITE setFilterChildren NOTIFY filterChildrenChanged)
+ // Note, threshold was added in QtQuick 2.2 but REVISION is not supported (or needed) for grouped
+ // properties See QTBUG-33179
+ Q_PROPERTY(qreal threshold READ threshold WRITE setThreshold NOTIFY thresholdChanged RESET resetThreshold)
//### consider drag and drop
public:
@@ -182,6 +185,10 @@ public:
qreal ymax() const;
void setYmax(qreal);
+ qreal threshold() const;
+ void setThreshold(qreal);
+ void resetThreshold();
+
bool active() const;
void setActive(bool);
@@ -199,6 +206,7 @@ Q_SIGNALS:
void maximumYChanged();
void activeChanged();
void filterChildrenChanged();
+ void thresholdChanged();
private:
QQuickItem *_target;
@@ -209,6 +217,7 @@ private:
qreal _ymax;
bool _active : 1;
bool _filterChildren: 1;
+ qreal _threshold;
Q_DISABLE_COPY(QQuickDrag)
};