aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-09-15 13:56:36 +0200
committerAndy Shaw <andy.shaw@qt.io>2017-09-15 13:18:53 +0000
commitbfab1db38167d31f0487f96d2d4b02d9243bc777 (patch)
tree93635780b8b60859b0e116968700bacbc06b345f /src
parente29ffa179e9920443a23e2fcb3f0694df32e8a68 (diff)
Fall back to the ObjectWrapper for model advanceIterator
When falling back to the QObjectWrapper it will add in the extra parts added when the roles were added to the object created by the model to hold the data being returned. This was causing the last entry to be duplicated and causing extra work too. Task-number: QTBUG-54285 Task-number: QTBUG-62156 Change-Id: I2907477277df8d16db4491a4999f004433e4205c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/types/qqmllistmodel.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index b33be2b4fb..35ee30dccf 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1394,7 +1394,10 @@ void ModelObject::advanceIterator(Managed *m, ObjectIterator *it, Value *name, u
p->value = v4->fromVariant(value);
return;
}
- QV4::QObjectWrapper::advanceIterator(m, it, name, index, p, attributes);
+ // Fall back to QV4::Object as opposed to QV4::QObjectWrapper otherwise it will add
+ // unnecessary entries that relate to the roles used. These just create extra work
+ // later on as they will just be ignored.
+ QV4::Object::advanceIterator(m, it, name, index, p, attributes);
}
DEFINE_OBJECT_VTABLE(ModelObject);