diff options
author | Samuel Mira <samuel.mira@qt.io> | 2022-07-15 14:04:07 +0300 |
---|---|---|
committer | Samuel Mira <samuel.mira@qt.io> | 2022-07-20 16:19:17 +0300 |
commit | 0ff8be24fce1051fdefea269a64d5eceddc9d371 (patch) | |
tree | 234d7273f9b4afc2b2fe040c0e69e7455450db15 /src/quick/items | |
parent | 63d78523a98b40283b400445bae6f3371eed181b (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.cpp | 2 |
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 |