diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-08 09:52:18 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-08 09:52:18 (GMT) |
commit | d9f715adfbd0483f113f3108d5285c31833763c1 (patch) | |
tree | 21c9a747fdbcef0f73cad41789a2c48dd90508cc /src/declarative | |
parent | f41e84f6ce70e8b05f6cfcadc6780dc5ecc2f8b0 (diff) | |
download | Qt-d9f715adfbd0483f113f3108d5285c31833763c1.zip Qt-d9f715adfbd0483f113f3108d5285c31833763c1.tar.gz Qt-d9f715adfbd0483f113f3108d5285c31833763c1.tar.bz2 |
Small optimization
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlobjectscriptclass.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp index d3a2a22..41573a2 100644 --- a/src/declarative/qml/qmlobjectscriptclass.cpp +++ b/src/declarative/qml/qmlobjectscriptclass.cpp @@ -214,12 +214,13 @@ QScriptValue QmlObjectScriptClass::property(QObject *obj, const Identifier &name return enginePriv->valueTypeClass->newObject(obj, lastData->coreIndex, valueType); } - QVariant var = obj->metaObject()->property(lastData->coreIndex).read(obj); - if (lastData->flags & QmlPropertyCache::Data::IsQObjectDerived) { - QObject *rv = *(QObject **)var.constData(); + QObject *rv = 0; + void *args[] = { &rv, 0 }; + QMetaObject::metacall(obj, QMetaObject::ReadProperty, lastData->coreIndex, args); return newQObject(rv); } else { + QVariant var = obj->metaObject()->property(lastData->coreIndex).read(obj); return enginePriv->scriptValueFromVariant(var); } |