diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-11-13 14:43:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-12-11 19:37:09 +0000 |
commit | 52f7ab28172cea3710a16775b7a512fce821fc77 (patch) | |
tree | 62ead2ae446a78bab096d4a2266d3b6eb6a75282 /src/quick/handlers | |
parent | 92b17fd766205c18f692be4f58a31d76d57758ae (diff) |
fix bugs in native gesture event delivery
1) always use Item-localized coordinates when testing Item.contains()
2) QQuickPinchHandler::wantsPointerEvent() was returning true for all
native gestures, so in the manual test with two PinchHandlers,
it was possible to pinch them both at the same time.
Task-number: QTBUG-64848
Change-Id: Ia146aaf03f9982696ae2986249f8d4650a7bf727
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r-- | src/quick/handlers/qquickpinchhandler.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quick/handlers/qquickpinchhandler.cpp b/src/quick/handlers/qquickpinchhandler.cpp index 4db96d8a99..155822197f 100644 --- a/src/quick/handlers/qquickpinchhandler.cpp +++ b/src/quick/handlers/qquickpinchhandler.cpp @@ -248,8 +248,8 @@ bool QQuickPinchHandler::wantsPointerEvent(QQuickPointerEvent *event) if (!QQuickMultiPointHandler::wantsPointerEvent(event)) return false; - if (minimumPointCount() == 2) { - if (const auto gesture = event->asPointerNativeGestureEvent()) { + if (const auto gesture = event->asPointerNativeGestureEvent()) { + if (minimumPointCount() == 2) { switch (gesture->type()) { case Qt::BeginNativeGesture: case Qt::EndNativeGesture: @@ -259,6 +259,8 @@ bool QQuickPinchHandler::wantsPointerEvent(QQuickPointerEvent *event) default: return false; } + } else { + return false; } } |