diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-09 10:38:13 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-10 00:12:48 (GMT) |
commit | 932f667eaad727854f6bb48d797874455ed13231 (patch) | |
tree | 30fb3381e843400128a5f796184a17547b500068 /src/declarative/qml/qmlmetaproperty.cpp | |
parent | 25bed69b3c643943dac195227d3f3fadc441516c (diff) | |
download | Qt-932f667eaad727854f6bb48d797874455ed13231.zip Qt-932f667eaad727854f6bb48d797874455ed13231.tar.gz Qt-932f667eaad727854f6bb48d797874455ed13231.tar.bz2 |
Support URL resolution from within script blocks
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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: { |