diff options
author | Bartlomiej Moskal <bartlomiej.moskal@siili.com> | 2020-11-05 10:12:29 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-09 07:54:55 +0100 |
commit | a14e4fcdf94d26774490b26a4ef77981594f583f (patch) | |
tree | 6b1f08f61addd27b0213d6e7b09f55bb10273956 /src/quick/items/qquickwindow.cpp | |
parent | 3037e442d289b1c4ff037ee02f683c199673af6f (diff) |
QQuickWindow: Check if QQuickItem was not deleted
Added check into deliverMatchingPointsToItem method for Android device.
In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true
It causes delivering touch events to Items which are not interested
In some cases it may cause a crash. For example using Material Style in Android.
QQuickShaderEffectSource may be deleted and then try to handle touch
Fixes: QTBUG-85379
Pick-to: 5.15
Change-Id: Ia2c4e016db57ef9c86fcc31d4cfba6154068a546
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 0b17920d0b..384b334e9e 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2845,6 +2845,14 @@ bool QQuickWindowPrivate::deliverPressOrReleaseEvent(QPointerEvent *event, bool void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, bool isGrabber, QPointerEvent *pointerEvent, bool handlersOnly) { QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); +#if defined(Q_OS_ANDROID) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + // QTBUG-85379 + // In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true + // It causes delivering touch events to Items which are not interested + // In some cases (like using Material Style in Android) it may cause a crash + if (itemPrivate->wasDeleted) + return; +#endif localizePointerEvent(pointerEvent, item); bool isMouse = isMouseEvent(pointerEvent); |