summaryrefslogtreecommitdiffstats
path: root/src/declarative/util/qdeclarativepropertychanges.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-09 03:42:22 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-09 03:44:56 (GMT)
commitda56d7c25ce344128d827cfa2ed26f9eea437e4d (patch)
tree863bb2873aa12213b38c824940f8f58dc776d250 /src/declarative/util/qdeclarativepropertychanges.cpp
parent6e8342957d08d783c211fe0896c326aa44a13ee2 (diff)
downloadQt-da56d7c25ce344128d827cfa2ed26f9eea437e4d.zip
Qt-da56d7c25ce344128d827cfa2ed26f9eea437e4d.tar.gz
Qt-da56d7c25ce344128d827cfa2ed26f9eea437e4d.tar.bz2
Fix url resolution in PropertyChanges.
Make sure bindings in PropertyChanges resolve urls correctly. Also refactor the code so that PropertyChanges will always use the standard url resolution support provided by QDeclarativeProperty. Task-number: QTBUG-9571
Diffstat (limited to 'src/declarative/util/qdeclarativepropertychanges.cpp')
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index ecbd71e..9c3ee9f 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -377,7 +377,7 @@ QDeclarativeProperty
QDeclarativePropertyChangesPrivate::property(const QByteArray &property)
{
Q_Q(QDeclarativePropertyChanges);
- QDeclarativeProperty prop(object, QString::fromUtf8(property));
+ QDeclarativeProperty prop(object, QString::fromUtf8(property), qmlContext(q));
if (!prop.isValid()) {
qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(property));
return QDeclarativeProperty();
@@ -400,16 +400,11 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions()
QByteArray property = d->properties.at(ii).first;
- QDeclarativeAction a(d->object, QString::fromLatin1(property),
- d->properties.at(ii).second);
+ QDeclarativeAction a(d->object, QString::fromUtf8(property),
+ qmlContext(this), d->properties.at(ii).second);
if (a.property.isValid()) {
a.restore = restoreEntryValues();
-
- if (a.property.propertyType() == QVariant::Url &&
- (a.toValue.userType() == QVariant::String || a.toValue.userType() == QVariant::ByteArray) && !a.toValue.isNull())
- a.toValue.setValue(qmlContext(this)->resolvedUrl(QUrl(a.toValue.toString())));
-
list << a;
}
}
@@ -436,7 +431,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions()
a.property = prop;
a.fromValue = a.property.read();
a.specifiedObject = d->object;
- a.specifiedProperty = QString::fromLatin1(property);
+ a.specifiedProperty = QString::fromUtf8(property);
if (d->isExplicit) {
a.toValue = d->expressions.at(ii).second->value();