From 4d33a38f4b11cea2123b818487ff55f0988767bc Mon Sep 17 00:00:00 2001 From: kakadu Date: Thu, 24 Oct 2013 14:55:11 +0400 Subject: 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 --- src/qml/types/qqmlinstantiator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/types/qqmlinstantiator.cpp') diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp index f7b2f9254a..c28cfad9e3 100644 --- a/src/qml/types/qqmlinstantiator.cpp +++ b/src/qml/types/qqmlinstantiator.cpp @@ -115,7 +115,7 @@ void QQmlInstantiatorPrivate::_q_createdItem(int idx, QObject* item) if (objects.contains(item)) //Case when it was created synchronously in regenerate return; item->setParent(q); - objects << item; + objects.insert(idx, item); if (objects.count() == 1) q->objectChanged(); q->objectAdded(idx, item); -- cgit v1.2.3