diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-12-10 11:13:09 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-12-10 23:35:26 +0100 |
commit | b71d8a4ed5c80956b2efc9eb922e02da56e53bdb (patch) | |
tree | c11d8ba285ac3c934eb4584cda00331189a822e7 | |
parent | 8d848811dca437c125b45bdf03fb307ce9ca512f (diff) |
deliverSinglePointEventUntilAccepted(): skip items that aren't shown
This function is called for delivering other types of pointer events
than mouse and touch: tablet, wheel and native gesture events mainly.
It calls item->window()->mapToGlobal() so a crash is theoretically
possible in rare complex cases if pointerTargets() somehow found
items that are not in the window; so we add a null pointer check to
avoid crashing.
Fixes: QTBUG-82013
Change-Id: Id5b167a685a3ee7ae2d94338ce312930430e081b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-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 1e08498a28..47bb63e26e 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2199,6 +2199,8 @@ bool QQuickWindowPrivate::deliverSinglePointEventUntilAccepted(QQuickPointerEven QVector<QQuickItem *> targetItems = pointerTargets(contentItem, point, false, false); for (QQuickItem *item : targetItems) { + if (!item->window()) + continue; QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); event->localize(item); // Let Pointer Handlers have the first shot |