summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@nokia.com>2009-12-17 13:21:36 (GMT)
committerMarco Bubke <marco.bubke@nokia.com>2009-12-17 13:21:36 (GMT)
commitff8d23d5754ca7160ec1be6e5e8d573eca018713 (patch)
tree2610d1ea2b2911b0585b7f1d9362b3da7a360365 /src/declarative/qml
parentefa04f4357ef23a63dbb6e0cd3f8cdb1880e7886 (diff)
downloadQt-ff8d23d5754ca7160ec1be6e5e8d573eca018713.zip
Qt-ff8d23d5754ca7160ec1be6e5e8d573eca018713.tar.gz
Qt-ff8d23d5754ca7160ec1be6e5e8d573eca018713.tar.bz2
Add context argument to QmlMetaProperty::createProperty
Without a context the properties with a QUrl type are not resolved. Reviewed-by: Kai Koehne
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp9
-rw-r--r--src/declarative/qml/qmlmetaproperty.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index a315141..6738370 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -1121,11 +1121,12 @@ QmlMetaPropertyPrivate::restore(const QByteArray &data, QObject *object, QmlCont
\internal
Creates a QmlMetaProperty for the property \a name of \a obj. Unlike
- the QmlMetaProperty(QObject*, QString) constructor, this static function
+ the QmlMetaProperty(QObject*, QString, QmlContext*) constructor, this static function
will correctly handle dot properties.
*/
QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
- const QString &name)
+ const QString &name,
+ QmlContext *context)
{
QStringList path = name.split(QLatin1Char('.'));
@@ -1133,7 +1134,7 @@ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
for (int jj = 0; jj < path.count() - 1; ++jj) {
const QString &pathName = path.at(jj);
- QmlMetaProperty prop(object, pathName);
+ QmlMetaProperty prop(object, pathName, context);
if (jj == path.count() - 2 &&
prop.propertyType() < (int)QVariant::UserType &&
@@ -1159,7 +1160,7 @@ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
}
const QString &propName = path.last();
- QmlMetaProperty prop(object, propName);
+ QmlMetaProperty prop(object, propName, context);
if (!prop.isValid())
return QmlMetaProperty();
else
diff --git a/src/declarative/qml/qmlmetaproperty.h b/src/declarative/qml/qmlmetaproperty.h
index 4b343f0..dcb5905 100644
--- a/src/declarative/qml/qmlmetaproperty.h
+++ b/src/declarative/qml/qmlmetaproperty.h
@@ -127,7 +127,7 @@ public:
QmlExpression *signalExpression() const;
QmlExpression *setSignalExpression(QmlExpression *) const;
- static QmlMetaProperty createProperty(QObject *, const QString &);
+ static QmlMetaProperty createProperty(QObject *, const QString &, QmlContext *context=0);
int coreIndex() const;
int valueTypeCoreIndex() const;