diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-08-02 16:54:59 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-08-02 20:25:55 +0000 |
commit | a88f01364e147d9ea093bf0fdc639b45feef1788 (patch) | |
tree | cf1c49dee57f1c691eeecd633bffd0601256f236 /src/qml/qml/qqmlvaluetypewrapper.cpp | |
parent | 0d63c22eee293fe59d7691608deaaf3468045eb3 (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/qml/qqmlvaluetypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmlvaluetypewrapper.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp index 29f37fc217..2612518cb8 100644 --- a/src/qml/qml/qqmlvaluetypewrapper.cpp +++ b/src/qml/qml/qqmlvaluetypewrapper.cpp @@ -254,34 +254,6 @@ PropertyAttributes QQmlValueTypeWrapper::virtualGetOwnProperty(Managed *m, Prope return QV4::Object::virtualGetOwnProperty(m, id, p); } -void QQmlValueTypeWrapper::virtualAdvanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes) -{ - name->setM(nullptr); - *index = UINT_MAX; - - QQmlValueTypeWrapper *that = static_cast<QQmlValueTypeWrapper*>(m); - - if (QQmlValueTypeReference *ref = that->as<QQmlValueTypeReference>()) { - if (!ref->readReferenceValue()) - return; - } - - if (that->d()->propertyCache()) { - const QMetaObject *mo = that->d()->propertyCache()->createMetaObject(); - const int propertyCount = mo->propertyCount(); - if (it->arrayIndex < static_cast<uint>(propertyCount)) { - Scope scope(that->engine()); - ScopedString propName(scope, that->engine()->newString(QString::fromUtf8(mo->property(it->arrayIndex).name()))); - name->setM(propName->d()); - ++it->arrayIndex; - *attributes = QV4::Attr_Data; - p->value = that->QV4::Object::get(propName); - return; - } - } - QV4::Object::virtualAdvanceIterator(m, it, name, index, p, attributes); -} - struct QQmlValueTypeWrapperOwnPropertyKeyIterator : ObjectOwnPropertyKeyIterator { int propertyIndex = 0; |