From a88f01364e147d9ea093bf0fdc639b45feef1788 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 2 Aug 2018 16:54:59 +0200 Subject: Implement ObjectIterator using the new iteration mechanism And with that get rid of the old advanceIterator methods. Change-Id: I969fa89d25df8992a4b08c8c081b91c92ffdfddd Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlvaluetypewrapper.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src/qml/qml/qqmlvaluetypewrapper.cpp') 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(m); - - if (QQmlValueTypeReference *ref = that->as()) { - 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(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; -- cgit v1.2.3