summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;