aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/types
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-08-02 16:54:59 +0200
committerLars Knoll <lars.knoll@qt.io>2018-08-02 20:25:55 +0000
commita88f01364e147d9ea093bf0fdc639b45feef1788 (patch)
treecf1c49dee57f1c691eeecd633bffd0601256f236 /src/qml/types
parent0d63c22eee293fe59d7691608deaaf3468045eb3 (diff)
Implement ObjectIterator using the new iteration mechanism
And with that get rid of the old advanceIterator methods. Change-Id: I969fa89d25df8992a4b08c8c081b91c92ffdfddd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/types')
-rw-r--r--src/qml/types/qqmllistmodel.cpp23
-rw-r--r--src/qml/types/qqmllistmodel_p_p.h1
2 files changed, 0 insertions, 24 deletions
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 30e5b83d5c..8d1ea6f828 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1610,29 +1610,6 @@ ReturnedValue ModelObject::virtualGet(const Managed *m, PropertyKey id, const Va
return that->engine()->fromVariant(value);
}
-void ModelObject::virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)
-{
- ModelObject *that = static_cast<ModelObject*>(m);
- ExecutionEngine *v4 = that->engine();
- name->setM(nullptr);
- *index = UINT_MAX;
- if (it->arrayIndex < uint(that->d()->m_model->m_listModel->roleCount())) {
- Scope scope(that->engine());
- const ListLayout::Role &role = that->d()->m_model->m_listModel->getExistingRole(it->arrayIndex);
- ++it->arrayIndex;
- ScopedString roleName(scope, v4->newString(role.name));
- name->setM(roleName->d());
- *attributes = QV4::Attr_Data;
- QVariant value = that->d()->m_model->data(that->d()->elementIndex(), role.index);
- p->value = v4->fromVariant(value);
- return;
- }
- // 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::virtualAdvanceIterator(m, it, name, index, p, attributes);
-}
-
struct ModelObjectOwnPropertyKeyIterator : ObjectOwnPropertyKeyIterator
{
int roleNameIndex = 0;
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h
index dbd0b0a2a2..46a41ac8c8 100644
--- a/src/qml/types/qqmllistmodel_p_p.h
+++ b/src/qml/types/qqmllistmodel_p_p.h
@@ -181,7 +181,6 @@ struct ModelObject : public QObjectWrapper
protected:
static bool virtualPut(Managed *m, PropertyKey id, const Value& value, Value *receiver);
static ReturnedValue virtualGet(const Managed *m, PropertyKey id, const Value *receiver, bool *hasProperty);
- static void virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
static OwnPropertyKeyIterator *virtualOwnPropertyKeys(const Object *m);
};