aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlinstantiator/data
diff options
context:
space:
mode:
authorkakadu <kakadu.hafanana@gmail.com>2013-10-24 14:55:11 +0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-29 23:04:18 +0100
commit4d33a38f4b11cea2123b818487ff55f0988767bc (patch)
treea1c6dc9801315b40448b630b4ad20fd53accc88f /tests/auto/qml/qqmlinstantiator/data
parent3d96c688a919c3ebc0ea3822e59bbc728c68eb95 (diff)
Fix adding created objects to instantiator.
Before all new objects were pushed into the end of QVector, i.e. if item model changes object with low index newly created object will be added like it has big index. So, removing objects from instantiator was buggy. Task-number: QTBUG-33847. Change-Id: I49fba53a40fce72060b629f737c10b525c67cc86 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmlinstantiator/data')
-rw-r--r--tests/auto/qml/qqmlinstantiator/data/createAndRemove.qml18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlinstantiator/data/createAndRemove.qml b/tests/auto/qml/qqmlinstantiator/data/createAndRemove.qml
new file mode 100644
index 0000000000..5dd322b5f5
--- /dev/null
+++ b/tests/auto/qml/qqmlinstantiator/data/createAndRemove.qml
@@ -0,0 +1,18 @@
+import QtQml 2.1
+import QtQuick 2.1
+
+Rectangle {
+ Instantiator {
+ objectName: "instantiator1"
+ model: model1
+ delegate: QtObject {
+ property string datum: model.text
+ }
+ }
+ Component.onCompleted: {
+ model1.add("Delta");
+ model1.add("Gamma");
+ model1.add("Beta");
+ model1.add("Alpha");
+ }
+}