aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-10-13 16:25:57 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-10-17 08:47:42 +0000
commit71031b6e8c53a63f77542dbaaae05ca916287cfc (patch)
treea1bce4d24819124be179edc8cd04f994fc1da5be /tests
parentb8141609d2ee962b919e1f05f7bd12ebc2ca9d11 (diff)
QQuickContainer: fix itemSiblingOrderChanged()
The problem was that QQuickContainer started already moving items while QQmlObjectModel was creating items and QQuickRepeater was initializing the order. Don't reorder items during the creation, but only after component completion. Task-number: QTBUG-61310 Change-Id: I13380c5ab6b3bddaad3fa03ef6fb028622b4cd11 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_container.qml30
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/auto/controls/data/tst_container.qml b/tests/auto/controls/data/tst_container.qml
index b8de2b08..7c5efc1f 100644
--- a/tests/auto/controls/data/tst_container.qml
+++ b/tests/auto/controls/data/tst_container.qml
@@ -128,7 +128,7 @@ TestCase {
}
Component {
- id: repeaterContainer
+ id: repeaterContainer1
Container {
id: container
Item { objectName: "0" }
@@ -143,9 +143,33 @@ TestCase {
}
}
+ Component {
+ id: repeaterContainer2
+ Container {
+ id: container
+ contentItem: Item {
+ Repeater {
+ model: container.contentModel
+ }
+ Rectangle { objectName: "extra" }
+ }
+ Rectangle { objectName: "0" }
+ Rectangle { objectName: "1" }
+ Rectangle { objectName: "2" }
+ Rectangle { objectName: "3" }
+ }
+ }
+
+ function test_repeater_data() {
+ return [
+ { tag: "1", component: repeaterContainer1 },
+ { tag: "2", component: repeaterContainer2 }
+ ]
+ }
+
// don't crash (QTBUG-61310)
- function test_repeater() {
- var control = createTemporaryObject(repeaterContainer)
+ function test_repeater(data) {
+ var control = createTemporaryObject(data.component)
verify(control)
compare(control.itemAt(0).objectName, "0")