aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2017-11-13 14:43:54 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-12-11 19:37:09 +0000
commit52f7ab28172cea3710a16775b7a512fce821fc77 (patch)
tree62ead2ae446a78bab096d4a2266d3b6eb6a75282 /src/quick/items/qquickwindow.cpp
parent92b17fd766205c18f692be4f58a31d76d57758ae (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/items/qquickwindow.cpp')
-rw-r--r--src/quick/items/qquickwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 2dc3caf430..530d165850 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1938,7 +1938,8 @@ bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGes
{
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
- if ((itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape) && !item->contains(event->localPos()))
+ QPointF p = item->mapFromScene(event->windowPos());
+ if ((itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape) && !item->contains(p))
return false;
QList<QQuickItem *> children = itemPrivate->paintOrderChildItems();
@@ -1961,7 +1962,6 @@ bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGes
}
// If still not accepted, try direct delivery to the item
- QPointF p = item->mapFromScene(event->localPos());
if (item->contains(p)) {
QNativeGestureEvent copy(event->gestureType(), event->device(), p, event->windowPos(), event->screenPos(),
event->value(), 0L, 0L); // TODO can't copy things I can't access