Port list properties away from QQmlVmeVariant
authorFrank Meerkoetter <frank.meerkoetter@basyskom.com>
Mon, 20 Jul 2015 18:35:34 +0000 (20:35 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 18 Aug 2015 20:25:38 +0000 (20:25 +0000)
The index into the list of list properties (an int) is now also
stored as a QV4::Value.

Change-Id: I16809c5027ed3c4264aab6dfed8b4519adf83e2a
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/qml/qml/qqmlvmemetaobject.cpp

index d4ad0f2..1e60b59 100644 (file)
@@ -546,7 +546,7 @@ QQmlVMEMetaObject::QQmlVMEMetaObject(QObject *obj,
         int t = (metaData->propertyData() + ii)->propertyType;
         if (t == list_type) {
             listProperties.append(List(methodOffset() + ii, this));
-            data[ii].setValue(listProperties.count() - 1);
+            writeProperty(ii, listProperties.count() - 1);
         } else if (!needsJSWrapper && (t == qobject_type || t == variant_type)) {
             needsJSWrapper = true;
         }
@@ -993,7 +993,7 @@ int QQmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a)
                             break;
                         }
                         if (t == qMetaTypeId<QQmlListProperty<QObject> >()) {
-                            int listIndex = data[id].asInt();
+                            const int listIndex = readPropertyAsInt(id);
                             const List *list = &listProperties.at(listIndex);
                             *reinterpret_cast<QQmlListProperty<QObject> *>(a[0]) =
                                 QQmlListProperty<QObject>(object, const_cast<List *>(list),