diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-08 11:18:50 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-08 14:26:31 +0000 |
commit | 56c9ce5fac873e5c1e20a6a965eb750a81373968 (patch) | |
tree | 080e425a1d0f4690ccc55a13b7da567aa5f223b6 /tests | |
parent | 6d32604fd1560fd0dbf10eac702bbf3e9c448875 (diff) |
Fix QQuickContainerPrivate::itemSiblingOrderChanged()
Repeaters are not part of the content model. Exclude them when
calculating the target index when the order of items changes.
Task-number: QTBUG-61310
Change-Id: Iaedd59288ed38e985a34ed8e1f515fdfb50d74e6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_container.qml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_container.qml b/tests/auto/controls/data/tst_container.qml index 049982fb..b8de2b08 100644 --- a/tests/auto/controls/data/tst_container.qml +++ b/tests/auto/controls/data/tst_container.qml @@ -126,4 +126,31 @@ TestCase { compare(control1.currentIndex, 1) compare(control2.currentIndex, 1) } + + Component { + id: repeaterContainer + Container { + id: container + Item { objectName: "0" } + Item { objectName: "1" } + Item { objectName: "2" } + Item { objectName: "3" } + contentItem: Row { + Repeater { + model: container.contentModel + } + } + } + } + + // don't crash (QTBUG-61310) + function test_repeater() { + var control = createTemporaryObject(repeaterContainer) + verify(control) + + compare(control.itemAt(0).objectName, "0") + compare(control.itemAt(1).objectName, "1") + compare(control.itemAt(2).objectName, "2") + compare(control.itemAt(3).objectName, "3") + } } |