summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qmlbinding.cpp4
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp25
2 files changed, 25 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlbinding.cpp b/src/declarative/qml/qmlbinding.cpp
index 39851ff..f9c9561 100644
--- a/src/declarative/qml/qmlbinding.cpp
+++ b/src/declarative/qml/qmlbinding.cpp
@@ -126,10 +126,6 @@ void QmlBinding::update()
value = con(value.toString());
}
- if (d->property.propertyType() == QVariant::Url &&
- (value.type() == QVariant::String || value.type() == QVariant::ByteArray) && !value.isNull())
- value.setValue(context()->resolvedUrl(QUrl(value.toString())));
-
if (d->property.propertyType() == QVariant::Vector3D &&
value.type() == QVariant::String) {
value = qVariantFromValue(QmlStringConverters::vector3DFromString(value.toString()));
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index fdba79e..affb93b 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -874,6 +874,31 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value)
}
break;
+ case QVariant::Url:
+ {
+ QUrl u;
+ if (vt == QVariant::ByteArray) {
+ u = QUrl(QLatin1String(value.toByteArray()));
+ found = true;
+ } else if (QVariant::String) {
+ u = QUrl(value.toString());
+ found = true;
+ }
+
+ if (context && u.isRelative())
+ u = context->baseUrl().resolved(u);
+
+ if (found) {
+ void *a[1];
+ a[0] = &u;
+ QMetaObject::metacall(object,
+ QMetaObject::WriteProperty,
+ coreIdx, a);
+ }
+
+ }
+ break;
+
default:
{