aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-09-14 22:02:55 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-10-09 13:06:35 +0000
commit8e7d1a91196197eee4e45bbfa9886ab935e2b67c (patch)
tree9bc7bb0e99dfa5216a6b71941171b2251c77bd38 /src/qml/qml/qqmlproperty.cpp
parentd9541bde71f1adc81753283dc40ea6a8af009d8a (diff)
Make QML composite types inherit attached properties
Change-Id: Ic06af4805da987dd08e361f2668e7a1788d3eefe Task-number: QTBUG-43581 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlproperty.cpp')
-rw-r--r--src/qml/qml/qqmlproperty.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index d3f7070528..1b78ada698 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -248,10 +248,11 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name)
QQmlTypeNameCache::Result r = typeNameCache->query(pathName);
if (r.isValid()) {
if (r.type) {
- QQmlAttachedPropertiesFunc func = r.type->attachedPropertiesFunction();
+ QQmlEnginePrivate *enginePrivate = QQmlEnginePrivate::get(engine);
+ QQmlAttachedPropertiesFunc func = r.type->attachedPropertiesFunction(enginePrivate);
if (!func) return; // Not an attachable type
- currentObject = qmlAttachedPropertiesObjectById(r.type->attachedPropertiesId(), currentObject);
+ currentObject = qmlAttachedPropertiesObjectById(r.type->attachedPropertiesId(enginePrivate), currentObject);
if (!currentObject) return; // Something is broken with the attachable type
} else if (r.importNamespace) {
if ((ii + 1) == path.count()) return; // No type following the namespace
@@ -259,10 +260,11 @@ void QQmlPropertyPrivate::initProperty(QObject *obj, const QString &name)
++ii; r = typeNameCache->query(path.at(ii), r.importNamespace);
if (!r.type) return; // Invalid type in namespace
- QQmlAttachedPropertiesFunc func = r.type->attachedPropertiesFunction();
+ QQmlEnginePrivate *enginePrivate = QQmlEnginePrivate::get(engine);
+ QQmlAttachedPropertiesFunc func = r.type->attachedPropertiesFunction(enginePrivate);
if (!func) return; // Not an attachable type
- currentObject = qmlAttachedPropertiesObjectById(r.type->attachedPropertiesId(), currentObject);
+ currentObject = qmlAttachedPropertiesObjectById(r.type->attachedPropertiesId(enginePrivate), currentObject);
if (!currentObject) return; // Something is broken with the attachable type
} else if (r.scriptIndex != -1) {