aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickwindow/data
diff options
context:
space:
mode:
authorJosh Faust <jfaust@suitabletech.com>2013-08-01 16:51:03 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-12 21:38:20 +0200
commitb00a120d4d07d657f3226407cdae797395f63a16 (patch)
treeb08fb2a7fdcfc3c8f7748783146176a1cf2b9fa1 /tests/auto/quick/qquickwindow/data
parent602bec12868365323777298989ef4a1bf559cfac (diff)
Fix hover event crash
It was possible for a hover event to be sent to a QQuickItem that has already been scheduled to be deleted (through deleteLater()). This lead to an access on an already-freed object when the leave event is generated. This change ensures that the item is part of a scene before generating the hover enter event. Task-number: QTBUG-32771 Change-Id: I69adb6bbd0ae52c70a6bda4e6c918b7671549a4c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto/quick/qquickwindow/data')
-rw-r--r--tests/auto/quick/qquickwindow/data/hoverCrash.qml36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/data/hoverCrash.qml b/tests/auto/quick/qquickwindow/data/hoverCrash.qml
new file mode 100644
index 0000000000..936d9e4f43
--- /dev/null
+++ b/tests/auto/quick/qquickwindow/data/hoverCrash.qml
@@ -0,0 +1,36 @@
+import QtQuick 2.0
+import QtQuick.Window 2.0 as Window
+
+Window.Window {
+ width: 200
+ height: 200
+ color: "#00FF00"
+ Column {
+ Rectangle {
+ objectName: 'item1'
+ color: 'red'
+ width: 100
+ height: 100
+ MouseArea {
+ id: area
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+ }
+
+ Loader {
+ objectName: 'item2'
+ width: 100
+ height: 100
+ active: area.containsMouse
+ sourceComponent: Rectangle {
+ color: 'blue'
+
+ MouseArea {
+ anchors.fill: parent
+ hoverEnabled: true
+ }
+ }
+ }
+ }
+}