aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-01-11 12:42:47 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-01-19 12:47:55 +0100
commitd54285f9e430a8e32cb8f17a3e427be24c3dbfc1 (patch)
treebbb316c5348b252fcd99c0b007dc7215a77bd9a3 /tests
parent9028f0680d14f4d35a9cb0648b3027b9ffb90cf6 (diff)
QQuickAbstractButton: fix crash on destruction
If we listen for size changes we also need to remove the object listened to when it's deleted. (adapted from commit 720ffaeb60d43123522066e1de3a69ad551644aa in qtdeclarative) Fixes: QTBUG-99644 Change-Id: I9dc6ecc3636ee14f792dca8fa2d4bb5b3cdb3fa9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_switch.qml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_switch.qml b/tests/auto/controls/data/tst_switch.qml
index b3fab41c..10b6baa0 100644
--- a/tests/auto/controls/data/tst_switch.qml
+++ b/tests/auto/controls/data/tst_switch.qml
@@ -608,4 +608,27 @@ TestCase {
mouseClick(control.indicator)
verify(control.activeFocus)
}
+
+ Component {
+ id: deletionOrder1
+ Item {
+ Image { id: innerImage }
+ Switch { indicator: innerImage }
+ }
+ }
+
+ Component {
+ id: deletionOrder2
+ Item {
+ Switch { indicator: innerImage }
+ Image { id: innerImage }
+ }
+ }
+
+ function test_deletionOrder() {
+ var control1 = createTemporaryObject(deletionOrder1, testCase)
+ verify(control1)
+ var control2 = createTemporaryObject(deletionOrder2, testCase)
+ verify(control2)
+ }
}