diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-07-18 14:22:15 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-25 15:50:45 +0000 |
commit | e2910a5263dcec0ef5e2574a5a09eea100d29443 (patch) | |
tree | d5afcf2f32021f65c2ae2133b028fded323d1b89 /src/quick/items | |
parent | 5df47067e21eb0cd0cf1eed9ed7cb3d857c1f42a (diff) |
add QQuickWindowPrivate::dragOverThreshold
We now want to start checkng this with QQuickPointerEvent.
Change-Id: I6f439df4a11dcf6dc901dd55002f4c108b628c87
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 9 | ||||
-rw-r--r-- | src/quick/items/qquickwindow_p.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 66b87850f8..29c9a23012 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2628,6 +2628,15 @@ bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, const QTouch return overThreshold; } +bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, const QQuickEventPoint *p, int startDragThreshold) +{ + QStyleHints *styleHints = qApp->styleHints(); + bool overThreshold = qAbs(d) > (startDragThreshold >= 0 ? startDragThreshold : styleHints->startDragDistance()); + qreal velocity = axis == Qt::XAxis ? p->velocity().x() : p->velocity().y(); + overThreshold |= qAbs(velocity) > styleHints->startDragVelocity(); + return overThreshold; +} + /*! \qmlproperty list<Object> Window::data \default diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index a2a53fd2ce..b13dda4ef8 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -271,6 +271,7 @@ public: static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold = -1); static bool dragOverThreshold(qreal d, Qt::Axis axis, const QTouchEvent::TouchPoint *tp, int startDragThreshold = -1); + static bool dragOverThreshold(qreal d, Qt::Axis axis, const QQuickEventPoint *tp, int startDragThreshold = -1); // data property static void data_append(QQmlListProperty<QObject> *, QObject *); |