diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-27 07:45:25 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-04-27 07:45:25 (GMT) |
commit | eae3489b3f2fba9d733ca50eb89dc92a6e96e6f8 (patch) | |
tree | c114a1d79932d0b0d7ab811040a50a7241323789 /src/declarative/qml/qmlmetaproperty.cpp | |
parent | 768658b51ebabff535263efb0870b436beb00fcc (diff) | |
parent | d545dc70c03eca620275658450402f67af166ef0 (diff) | |
download | Qt-eae3489b3f2fba9d733ca50eb89dc92a6e96e6f8.zip Qt-eae3489b3f2fba9d733ca50eb89dc92a6e96e6f8.tar.gz Qt-eae3489b3f2fba9d733ca50eb89dc92a6e96e6f8.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 1218b99..e7f7cfb 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -103,7 +103,18 @@ QmlMetaProperty::~QmlMetaProperty() // ### not thread safe static QHash<const QMetaObject *, QMetaPropertyEx> qmlCacheDefProp; + +/*! + Creates a QmlMetaProperty for the default property of \a obj. If there is no + default property, an invalid QmlMetaProperty will be created. + */ +QmlMetaProperty::QmlMetaProperty(QObject *obj) +{ + initDefault(obj); +} + /*! + \internal Creates a QmlMetaProperty for the default property of \a obj. If there is no default property, an invalid QmlMetaProperty will be created. */ @@ -111,6 +122,11 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, QmlContext *ctxt) : d(new QmlMetaPropertyPrivate) { d->context = ctxt; + initDefault(obj); +} + +void QmlMetaProperty::initDefault(QObject *obj) +{ if(!obj) return; @@ -162,6 +178,16 @@ static QHash<const QMetaObject *, QHash<QString, QMetaPropertyEx> > qmlCacheProp /*! Creates a QmlMetaProperty for the property \a name of \a obj. */ +QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name) +: d(new QmlMetaPropertyPrivate) +{ + initProperty(obj, name); +} + +/*! + \internal + Creates a QmlMetaProperty for the property \a name of \a obj. + */ QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name, QmlContext *ctxt) : d(new QmlMetaPropertyPrivate) { @@ -170,6 +196,11 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name, QmlContext * #endif d->context = ctxt; + initProperty(obj, name); +} + +void QmlMetaProperty::initProperty(QObject *obj, const QString &name) +{ d->name = name; d->object = obj; if(name.isEmpty() || !obj) |