path: root/src
diff options
authorJ-P Nurmi <jpnurmi@qt.io>2017-05-17 22:28:13 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-29 20:03:50 +0000
commit95f6dcbae17b72c8dfebc9f97c77310151b63ceb (patch)
tree3bf62ee34dc7faa1fd5169f65a57c5032e1c940e /src
parenta813d8a4d87e22a87722fada10710711b1d4306f (diff)
Fix ObjectModel::move() to mark the changes as moves
QQmlObjectModel::move() created a QQmlChangeSet with moveId -1, which made item views and controls see the changes as removals and insertions, because QQmlChangeSet::Change::isMove() returned false. Consequently, item views did not update the current index when the current item was moved. Task-number: QTBUG-60894 Change-Id: I4a64b7670c1fae12337995627437cc83efb9f1ef Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp
index 2814b9d38f..64d0169f6b 100644
--- a/src/qml/types/qqmlobjectmodel.cpp
+++ b/src/qml/types/qqmlobjectmodel.cpp
@@ -129,7 +129,7 @@ public:
QQmlChangeSet changeSet;
- changeSet.move(from, to, n, -1);
+ changeSet.move(from, to, n, 0);
emit q->modelUpdated(changeSet, false);
emit q->childrenChanged();