aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qquickwidget.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2024-01-04 00:07:05 -0700
committerShawn Rutledge <shawn.rutledge@qt.io>2024-01-20 10:18:24 -0700
commit59b0b59090e2ff3f04bd15120720ee6a5b0c3f4b (patch)
tree1d76dff599197c49d0b5dfc0c3ed4e15146b2cb9 /src/quickwidgets/qquickwidget.cpp
parent1b438b0395ba042604f6221712b5de20423130a1 (diff)
QQuickWidget: accept touchpoint even if it has a passive grab
In the test case from QTBUG-113558, a QQuickWidget's only event-handling object is a TapHandler with its default gesturePolicy, so that on touch press, it gets pressed; but it was missing the touch release and getting stuck in pressed state. As explained in dc8f44b14501ecd4acc196f5138aeff3f7502d0a, widgets don't care about (exclusive or passive) grabbers, and rely on points being accepted to make the widget that received the TouchBegin an implicit grabber. If the only thing that happened in the Qt Quick scene in the QQuickWidget is that the touchpoint got a passive grab, it's still a kind of interaction, and we want to ensure that the TapHandler will see the release too, to avoid getting stuck. (This means that passive grabs are not passive from the perspective of widget event delivery: the TapHandler ends up excluding delivery of the touchpoint to other widgets, even though it didn't mean to. But hopefully nobody expects cooperation with touch-handling widgets underneath the Quick scene.) Fixes: QTBUG-113558 Pick-to: 6.5 6.6 6.7 Change-Id: Ided6247b43a2405dbfdf9d195bb45ceae4cf58fd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/quickwidgets/qquickwidget.cpp')
-rw-r--r--src/quickwidgets/qquickwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 5b3e4394ce..c2c0f6f8d3 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -1665,7 +1665,7 @@ bool QQuickWidget::event(QEvent *e)
QPointerEvent *pointerEvent = static_cast<QPointerEvent *>(e);
auto deliveredPoints = pointerEvent->points();
for (auto &point : deliveredPoints) {
- if (pointerEvent->exclusiveGrabber(point))
+ if (pointerEvent->exclusiveGrabber(point) || !pointerEvent->passiveGrabbers(point).isEmpty())
point.setAccepted(true);
}
}