|
|
383017 |
From 81238e0ff8453f4fb78436ac9bec8452584680ae Mon Sep 17 00:00:00 2001
|
|
|
383017 |
From: Bartlomiej Moskal <bartlomiej.moskal@siili.com>
|
|
|
383017 |
Date: Thu, 5 Nov 2020 10:12:29 +0100
|
|
|
383017 |
Subject: [PATCH 06/28] QQuickWindow: Check if QQuickItem was not deleted
|
|
|
383017 |
|
|
|
383017 |
Added check into deliverMatchingPointsToItem method for Android device.
|
|
|
383017 |
|
|
|
383017 |
In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true
|
|
|
383017 |
It causes delivering touch events to Items which are not interested
|
|
|
383017 |
In some cases it may cause a crash. For example using Material Style in Android.
|
|
|
383017 |
QQuickShaderEffectSource may be deleted and then try to handle touch
|
|
|
383017 |
|
|
|
383017 |
Fixes: QTBUG-85379
|
|
|
383017 |
Change-Id: Ia2c4e016db57ef9c86fcc31d4cfba6154068a546
|
|
|
383017 |
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
383017 |
(cherry picked from commit a14e4fcdf94d26774490b26a4ef77981594f583f)
|
|
|
383017 |
Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@siili.com>
|
|
|
383017 |
---
|
|
|
383017 |
src/quick/items/qquickwindow.cpp | 8 ++++++++
|
|
|
383017 |
1 file changed, 8 insertions(+)
|
|
|
383017 |
|
|
|
383017 |
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
|
|
|
383017 |
index d0c9ad5454..9ff91eb9a0 100644
|
|
|
383017 |
--- a/src/quick/items/qquickwindow.cpp
|
|
|
383017 |
+++ b/src/quick/items/qquickwindow.cpp
|
|
|
383017 |
@@ -2864,6 +2864,14 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
|
|
|
383017 |
{
|
|
|
383017 |
Q_Q(QQuickWindow);
|
|
|
383017 |
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
|
|
|
383017 |
+#if defined(Q_OS_ANDROID) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
|
383017 |
+ // QTBUG-85379
|
|
|
383017 |
+ // In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true
|
|
|
383017 |
+ // It causes delivering touch events to Items which are not interested
|
|
|
383017 |
+ // In some cases (like using Material Style in Android) it may cause a crash
|
|
|
383017 |
+ if (itemPrivate->wasDeleted)
|
|
|
383017 |
+ return;
|
|
|
383017 |
+#endif
|
|
|
383017 |
pointerEvent->localize(item);
|
|
|
383017 |
|
|
|
383017 |
// Let the Item's handlers (if any) have the event first.
|
|
|
383017 |
--
|
|
|
383017 |
2.31.1
|
|
|
383017 |
|