diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2015-09-17 13:40:10 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-09-25 18:53:30 +0000 |
commit | 1e1056fbea7686d976957a838dc68636b99ecffc (patch) | |
tree | 9ed14a19996a31d644f55a6322f28d848490b8a7 /src/qml | |
parent | 297eb535d9b237a1db32c2bde573967fd4485aa5 (diff) |
Cleanup
Restructure code to make the flow more obvious and avoid
executing code that is afterwards being ignored for list
properties.
Change-Id: I1b21562d48cec34ecb722f9012166926d55e4724
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmlvmemetaobject.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp index 64f5bfefd7..294d539e92 100644 --- a/src/qml/qml/qqmlvmemetaobject.cpp +++ b/src/qml/qml/qqmlvmemetaobject.cpp @@ -612,23 +612,24 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void * break; default: { - QV4::MemberData *md = propertiesAsMemberData(); - if (md) { - QV4::VariantObject *v = (md->data() + id)->as<QV4::VariantObject>(); - if (v) - QQml_valueTypeProvider()->readValueType(v->d()->data, a[0], t); + if (t == qMetaTypeId<QQmlListProperty<QObject> >()) { + const int listIndex = readPropertyAsInt(id); + const List *list = &listProperties.at(listIndex); + *reinterpret_cast<QQmlListProperty<QObject> *>(a[0]) = + QQmlListProperty<QObject>(object, const_cast<List *>(list), + list_append, list_count, list_at, + list_clear); + } else { + QV4::MemberData *md = propertiesAsMemberData(); + if (md) { + QV4::VariantObject *v = (md->data() + id)->as<QV4::VariantObject>(); + if (v) + QQml_valueTypeProvider()->readValueType(v->d()->data, a[0], t); + } } break; } } - if (t == qMetaTypeId<QQmlListProperty<QObject> >()) { - const int listIndex = readPropertyAsInt(id); - const List *list = &listProperties.at(listIndex); - *reinterpret_cast<QQmlListProperty<QObject> *>(a[0]) = - QQmlListProperty<QObject>(object, const_cast<List *>(list), - list_append, list_count, list_at, - list_clear); - } } else if (c == QMetaObject::WriteProperty) { |