aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-01-11 12:42:47 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-14 13:46:40 +0000
commitbfb3f8f71b5ae5eccca5fffbb0de2ab76db1e91f (patch)
treeffb53d4c1d407392634a46a31af2df60b6b2a999 /tests
parentaf7f92a348289bff055cc34357b049b18c5033f3 (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. Fixes: QTBUG-99644 Change-Id: I613855ebd986b1e67685088020b88d8b070659cf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 720ffaeb60d43123522066e1de3a69ad551644aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quickcontrols2/controls/data/tst_switch.qml23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/controls/data/tst_switch.qml b/tests/auto/quickcontrols2/controls/data/tst_switch.qml
index 9f6bb002c4..bf25fcacff 100644
--- a/tests/auto/quickcontrols2/controls/data/tst_switch.qml
+++ b/tests/auto/quickcontrols2/controls/data/tst_switch.qml
@@ -617,4 +617,27 @@ TestCase {
// should not get activeFocus on mouseClick on macOS
compare(control.activeFocus, Qt.platform.os !== "osx" && Qt.platform.os !== "macos")
}
+
+ 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)
+ }
}