aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-23 23:10:02 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-26 07:54:08 +0000
commit5322ad410a78e43a86bb00b9765698c59f9449cb (patch)
tree291097cd61b8ce4fb3fd547da5cf1dab55eaae74 /tests
parent56bddc7fa4b0222d38fcc5e083b9588c3d2f8b93 (diff)
Fix a crash in StackView::pop()
If an item is still activating (from a previous pop) when it gets already popped out, we must not set the deactivating status before calling prepareTransition(). This method cancels and finishes the ongoing activation transition, and if the status says that the item was deactivating, the item gets destroyed in the middle of preparing for the deactivation transition. Let prepareTransition() cancel any ongoing transition first, and then set the status after the preparation. The cleanest way is to pass the target status to startTransition() and completeTransition(). Task-number: QTBUG-56158 Change-Id: Id52752200b650ea9f84659bbf43431f8a8b22f1e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_stackview.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 6d0433d4..ab6ce332 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -861,4 +861,22 @@ TestCase {
control.destroy()
}
+
+ // QTBUG-56158
+ function test_repeatedPop() {
+ var control = stackView.createObject(testCase, {initialItem: component, width: testCase.width, height: testCase.height})
+ verify(control)
+
+ for (var i = 0; i < 12; ++i)
+ control.push(component)
+ tryCompare(control, "busy", false)
+
+ while (control.depth > 1) {
+ control.pop()
+ wait(50)
+ }
+ tryCompare(control, "busy", false)
+
+ control.destroy()
+ }
}