diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-22 06:50:10 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-22 06:50:10 (GMT) |
commit | 98c4fb27bb930f19365395a3fd75e4c3012640cb (patch) | |
tree | ce58ff89b6baa3b8b64cd1445be702022ef3c051 | |
parent | ce49990c3764304e76b4d2c1705fcad677ec9f73 (diff) | |
download | Qt-98c4fb27bb930f19365395a3fd75e4c3012640cb.zip Qt-98c4fb27bb930f19365395a3fd75e4c3012640cb.tar.gz Qt-98c4fb27bb930f19365395a3fd75e4c3012640cb.tar.bz2 |
Use the true metatype of attached properties in the compiler
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlpackage.cpp | 2 | ||||
-rw-r--r-- | src/declarative/util/qmlpackage.h | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 8990732..5f92721 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -862,6 +862,10 @@ bool QmlCompiler::compileProperty(Property *prop, Object *obj, int ctxt) prop->type = t; } } + } else if(isAttachedProperty(prop->name) && prop->value) { + QmlType *type = QmlMetaType::qmlType(prop->name); + if (type && type->attachedPropertiesType()) + prop->value->metatype = type->attachedPropertiesType(); } if (prop->name == "id") { diff --git a/src/declarative/util/qmlpackage.cpp b/src/declarative/util/qmlpackage.cpp index bfad44c..107bcdb 100644 --- a/src/declarative/util/qmlpackage.cpp +++ b/src/declarative/util/qmlpackage.cpp @@ -142,7 +142,7 @@ QObject *QmlPackage::part(const QString &name) return 0; } -QObject *QmlPackage::qmlAttachedProperties(QObject *o) +QmlPackageAttached *QmlPackage::qmlAttachedProperties(QObject *o) { return new QmlPackageAttached(o); } diff --git a/src/declarative/util/qmlpackage.h b/src/declarative/util/qmlpackage.h index 3861890..f4167fd 100644 --- a/src/declarative/util/qmlpackage.h +++ b/src/declarative/util/qmlpackage.h @@ -57,6 +57,7 @@ QT_MODULE(Declarative) *****************************************************************************/ class QmlPackagePrivate; +class QmlPackageAttached; class QmlPackage : public QObject { Q_OBJECT @@ -74,7 +75,7 @@ public: QObject *part(const QString & = QString()); bool hasPart(const QString &); - static QObject *qmlAttachedProperties(QObject *); + static QmlPackageAttached *qmlAttachedProperties(QObject *); }; QML_DECLARE_TYPE(QmlPackage); |