aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-05-23 14:39:01 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-05-24 14:08:18 +0000
commit70c536b0473529710d36f32e516e6d962a0cb3dc (patch)
tree9d1e41dde8a8a015f74e0068799d31faa4bcb53f /src/qml/qml/qqmlvmemetaobject.cpp
parent641beae32735a39b861252be859b5381b5158fcc (diff)
Get rid of QQmlVMEMetaData::AliasData
The remaining signal index for the changed signal of the alias target is something that we need only once (when doing the initial alias endpoint connection) and then we can retrieve it from the property cache. Change-Id: Ifbd4625f9af3ca00c9b916eee5c82f58450d54ef Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject.cpp')
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 1eb49c1c3f..674cd075e1 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -150,15 +150,23 @@ void QQmlVMEMetaObjectEndpoint::tryConnect()
metaObject->activate(metaObject->object, sigIdx, 0);
} else {
const QV4::CompiledData::Alias *aliasData = &metaObject->compiledObject->aliasTable()[aliasId];
- QQmlVMEMetaData::AliasData *d = metaObject->metaData->aliasData() + aliasId;
if (!aliasData->isObjectAlias()) {
QQmlContextData *ctxt = metaObject->ctxt;
QObject *target = ctxt->idValues[aliasData->targetObjectId].data();
if (!target)
return;
- if (d->notifySignal != -1)
- connect(target, d->notifySignal, ctxt->engine);
+ QQmlData *targetDData = QQmlData::get(target, /*create*/false);
+ if (!targetDData)
+ return;
+ int coreIndex;
+ QQmlPropertyData::decodeValueTypePropertyIndex(aliasData->encodedMetaPropertyIndex, &coreIndex);
+ const QQmlPropertyData *pd = targetDData->propertyCache->property(coreIndex);
+ if (!pd)
+ return;
+
+ if (pd->notifyIndex != -1)
+ connect(target, pd->notifyIndex, ctxt->engine);
}
metaObject.setFlag();