diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-09 10:17:04 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-09 10:17:04 (GMT) |
commit | a700d7c263748d3635eb06a7091164fd75ec608c (patch) | |
tree | 17fc6e408bc49003ddb5800ca6a60f5725849626 /src/declarative/qml/qmlvmemetaobject.cpp | |
parent | 65aa9ff2704fed181eee2b189fc0db81a59ff75f (diff) | |
download | Qt-a700d7c263748d3635eb06a7091164fd75ec608c.zip Qt-a700d7c263748d3635eb06a7091164fd75ec608c.tar.gz Qt-a700d7c263748d3635eb06a7091164fd75ec608c.tar.bz2 |
Add id aliases
Diffstat (limited to 'src/declarative/qml/qmlvmemetaobject.cpp')
-rw-r--r-- | src/declarative/qml/qmlvmemetaobject.cpp | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/declarative/qml/qmlvmemetaobject.cpp b/src/declarative/qml/qmlvmemetaobject.cpp index f473743..a324795 100644 --- a/src/declarative/qml/qmlvmemetaobject.cpp +++ b/src/declarative/qml/qmlvmemetaobject.cpp @@ -181,20 +181,32 @@ int QmlVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) (QmlContextPrivate *)QObjectPrivate::get(ctxt); QObject *target = ctxtPriv->idValues[d->contextIdx].data(); - if (!target) return -1; + if (!target) { + if (d->propertyIdx == -1) + *reinterpret_cast<QObject **>(a[0]) = target; + return -1; + } if (c == QMetaObject::ReadProperty && !aConnected.testBit(id)) { int sigIdx = methodOffset + id + metaData->propertyCount; QMetaObject::connect(ctxt, d->contextIdx + ctxtPriv->notifyIndex, object, sigIdx); - QMetaProperty prop = - target->metaObject()->property(d->propertyIdx); - if (prop.hasNotifySignal()) - QMetaObject::connect(target, prop.notifySignalIndex(), - object, sigIdx); + if (d->propertyIdx != -1) { + QMetaProperty prop = + target->metaObject()->property(d->propertyIdx); + if (prop.hasNotifySignal()) + QMetaObject::connect(target, prop.notifySignalIndex(), + object, sigIdx); + } aConnected.setBit(id); } - return QMetaObject::metacall(target, c, d->propertyIdx, a); + + if (d->propertyIdx == -1) { + *reinterpret_cast<QObject **>(a[0]) = target; + return -1; + } else { + return QMetaObject::metacall(target, c, d->propertyIdx, a); + } } return -1; |