diff options
Diffstat (limited to 'src/qml/types/qqmlinstantiator.cpp')
-rw-r--r-- | src/qml/types/qqmlinstantiator.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp index 0cec39790d..2de5875deb 100644 --- a/src/qml/types/qqmlinstantiator.cpp +++ b/src/qml/types/qqmlinstantiator.cpp @@ -155,7 +155,8 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo int difference = 0; QHash<int, QVector<QPointer<QObject> > > moved; - foreach (const QQmlChangeSet::Change &remove, changeSet.removes()) { + const QVector<QQmlChangeSet::Change> &removes = changeSet.removes(); + for (const QQmlChangeSet::Change &remove : removes) { int index = qMin(remove.index, objects.count()); int count = qMin(remove.index + remove.count, objects.count()) - index; if (remove.isMove()) { @@ -174,7 +175,8 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo difference -= remove.count; } - foreach (const QQmlChangeSet::Change &insert, changeSet.inserts()) { + const QVector<QQmlChangeSet::Change> &inserts = changeSet.inserts(); + for (const QQmlChangeSet::Change &insert : inserts) { int index = qMin(insert.index, objects.count()); if (insert.isMove()) { QVector<QPointer<QObject> > movedObjects = moved.value(insert.moveId); |