summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaiwei Li <daiweili@suitabletech.com>2015-01-27 18:47:20 -0800
committerDaiwei Li <daiweili@suitabletech.com>2015-02-05 10:09:47 +0000
commit13f53d45037629ad27b93e7a817dc0567dea5e66 (patch)
tree860eebe4735b259faad48b2fcf69c3602d0fd8fa /tests
parent5f7f27759e23fb1e5f3779a580adcf5bb6d5ecd6 (diff)
downloadqtquickcontrols-13f53d45037629ad27b93e7a817dc0567dea5e66.tar.gz
Fix crash when invalidating a layout while rearranging
Queue the invalidations and upates while rearranging and apply them after. If we do them during, we can delete the items being arranged, leading to a crash. Change-Id: Ic3fe25c52afd1c8d36644f3cf7e3377ba3bec9c1 Task-number: QTBUG-44139 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_gridlayout.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_gridlayout.qml b/tests/auto/controls/data/tst_gridlayout.qml
index e3d9a66b..8b271f02 100644
--- a/tests/auto/controls/data/tst_gridlayout.qml
+++ b/tests/auto/controls/data/tst_gridlayout.qml
@@ -924,5 +924,36 @@ Item {
layout.destroy()
}
+
+ Component {
+ id: layout_invalidateWhileRearranging_Component
+
+ GridLayout {
+ columns: 1
+ Rectangle {
+ height: 50
+ Layout.fillWidth: true
+ color: 'blue'
+ }
+
+ Rectangle {
+ height: 50
+ Layout.fillWidth: true
+ color: 'red'
+ onYChanged: {
+ visible = false;
+ }
+ }
+ }
+ }
+
+ function test_invalidateWhileRearranging_QTBUG_44139()
+ {
+ var layout = layout_invalidateWhileRearranging_Component.createObject(container)
+
+ waitForRendering(layout);
+ verify(layout.children[1].visible == false);
+ layout.destroy()
+ }
}
}