diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-09-14 22:02:55 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-09 13:06:35 +0000 |
commit | 8e7d1a91196197eee4e45bbfa9886ab935e2b67c (patch) | |
tree | 9bc7bb0e99dfa5216a6b71941171b2251c77bd38 /src/qml/qml/qqmltypewrapper.cpp | |
parent | d9541bde71f1adc81753283dc40ea6a8af009d8a (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/qqmltypewrapper.cpp')
-rw-r--r-- | src/qml/qml/qqmltypewrapper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index d70a4019b2..6c29f2fbb5 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -185,7 +185,7 @@ ReturnedValue QmlTypeWrapper::get(const Managed *m, String *name, bool *hasPrope // Fall through to base implementation } else if (w->d()->object) { - QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object); + QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(QQmlEnginePrivate::get(v4->qmlEngine())), object); if (ao) return QV4::QObjectWrapper::getQmlProperty(v4, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, hasProperty); @@ -241,7 +241,8 @@ void QmlTypeWrapper::put(Managed *m, String *name, const Value &value) QQmlType *type = w->d()->type; if (type && !type->isSingleton() && w->d()->object) { QObject *object = w->d()->object; - QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object); + QQmlEngine *e = scope.engine->qmlEngine(); + QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(QQmlEnginePrivate::get(e)), object); if (ao) QV4::QObjectWrapper::setQmlProperty(v4, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, value); } else if (type && type->isSingleton()) { |