summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlmetaproperty.cpp
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-04-27 02:56:38 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-04-27 02:56:38 (GMT)
commitddb7c72fae2c3acb7608c5979c6b425691cc14d3 (patch)
tree7ae45c87d85e475aa0d8bfc47ba6a581a5ff9f74 /src/declarative/qml/qmlmetaproperty.cpp
parent7b3bb2c188234aac63435ed563085ed392068be3 (diff)
downloadQt-ddb7c72fae2c3acb7608c5979c6b425691cc14d3.zip
Qt-ddb7c72fae2c3acb7608c5979c6b425691cc14d3.tar.gz
Qt-ddb7c72fae2c3acb7608c5979c6b425691cc14d3.tar.bz2
Add some constructors without QmlContext parameter.
and mark the existing constructors internal.
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index 30e0bbc..ef9e970 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -100,7 +100,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.
*/
@@ -108,6 +119,11 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, QmlContext *ctxt)
: d(new QmlMetaPropertyPrivate)
{
d->context = ctxt;
+ initDefault(obj);
+}
+
+void QmlMetaProperty::initDefault(QObject *obj)
+{
if(!obj)
return;
@@ -159,6 +175,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)
{
@@ -167,6 +193,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)