aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorSamuel Mira <samuel.mira@qt.io>2022-07-15 14:04:07 +0300
committerSamuel Mira <samuel.mira@qt.io>2022-07-20 16:19:17 +0300
commit0ff8be24fce1051fdefea269a64d5eceddc9d371 (patch)
tree234d7273f9b4afc2b2fe040c0e69e7455450db15 /src/quick/items
parent63d78523a98b40283b400445bae6f3371eed181b (diff)
Android: Fix crash on tap handler with a S-Pen
This patch fixes a crash using a S-Pen with QML TapHandler on Qt 5.15. The reason it was happening was because the item->window() was nullptr when it tried to run the mapToGlobal function. The item->windows becomes nullptr on handlePointerEvent function, so switching both lines is enough to fix this crash. Fixes: QTBUG-86805 Change-Id: I25f20650e97b5ad094a99c810379fb412fdb4222 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickwindow.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 18bf8212d1..e48b83d5fc 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2209,6 +2209,8 @@ bool QQuickWindowPrivate::deliverSinglePointEventUntilAccepted(QQuickPointerEven
itemPrivate->handlePointerEvent(event);
if (point->isAccepted())
return true;
+ if (!item->window())
+ continue;
QPointF g = item->window()->mapToGlobal(point->scenePosition().toPoint());
#if QT_CONFIG(wheelevent)
// Let the Item have a chance to handle it