diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-06-11 07:38:46 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-07-19 10:56:06 +0000 |
commit | ca7cdd71ee33f0d77eb6bf1367d2532e26155cb2 (patch) | |
tree | af1b30bffea87bedb23e8cd795f23692f29b50a9 /src/quick/items/qquickwindow.cpp | |
parent | d310ca768bb5f45bae4fcec9a5d8151b6a366b8d (diff) |
Make DragHandler a MultiPointHandler
That is, minimumPointCount can now be set to a value > 1 to require
multiple fingers to do the dragging, or to track the displacement
of multiple fingers to adjust some value (such as the tilt of a map).
Task-number: QTBUG-68106
Change-Id: Ib35823e36deb81c8b277d3070fcc758c7c019564
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index f921e3962b..22425a96a6 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2511,6 +2511,12 @@ bool QQuickWindowPrivate::deliverPressOrReleaseEvent(QQuickPointerEvent *event, int pointCount = event->pointCount(); QVector<QQuickItem *> targetItems; bool isTouchEvent = (event->asPointerTouchEvent() != nullptr); + if (isTouchEvent && event->isPressEvent()) { + // When a second point is pressed, we're starting over with delivery, so + // don't let prior conception of which one is acting as a mouse interfere + touchMouseId = -1; + touchMouseDevice = nullptr; + } for (int i = 0; i < pointCount; ++i) { auto point = event->point(i); point->setAccepted(false); // because otherwise touchEventForItem will ignore it @@ -2977,6 +2983,12 @@ bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent return overThreshold; } +bool QQuickWindowPrivate::dragOverThreshold(QVector2D delta) +{ + int threshold = qApp->styleHints()->startDragDistance(); + return qAbs(delta.x()) > threshold || qAbs(delta.y()) > threshold; +} + /*! \qmlproperty list<Object> Window::data \default |