aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-09-25 15:22:28 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-09-26 14:08:40 +0000
commitc2f9d8a99db280941237b7ed35052547d55bd014 (patch)
tree5b44a3c309faf40e784b354c52ea9ed34db60e54 /src
parentfa52bb665d6beb77a951c14c8edcba3541850afc (diff)
ObjectModel: provide unique move IDs
QQuickItemViewPrivate::removeItem() uses a QHash to store items that were removed due to a move. If the move IDs are not unique, multiple buffered moves end up overriding each other. This results to leaked items that are never released. Task-number: QTBUG-62607 Change-Id: I7e7e7fcd6b1b0aa50ed55643ba5674e98536f89f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/types/qqmlobjectmodel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp
index 64d0169f6b..dcd0360199 100644
--- a/src/qml/types/qqmlobjectmodel.cpp
+++ b/src/qml/types/qqmlobjectmodel.cpp
@@ -72,7 +72,7 @@ public:
int ref;
};
- QQmlObjectModelPrivate() : QObjectPrivate() {}
+ QQmlObjectModelPrivate() : QObjectPrivate(), moveId(0) {}
static void children_append(QQmlListProperty<QObject> *prop, QObject *item) {
int index = static_cast<QQmlObjectModelPrivate *>(prop->data)->children.count();
@@ -129,7 +129,7 @@ public:
}
QQmlChangeSet changeSet;
- changeSet.move(from, to, n, 0);
+ changeSet.move(from, to, n, ++moveId);
emit q->modelUpdated(changeSet, false);
emit q->childrenChanged();
}
@@ -166,7 +166,7 @@ public:
return -1;
}
-
+ uint moveId;
QList<Item> children;
};