diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-17 00:45:11 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-06-17 00:45:11 (GMT) |
commit | 146171c3a393b18a0345d36461c2f276d39b980f (patch) | |
tree | 5343024c83ca12fc575aa0319cb32913b52237e5 /src/declarative | |
parent | dc7d82434debd9b660dbdd963f88071a41b21897 (diff) | |
download | Qt-146171c3a393b18a0345d36461c2f276d39b980f.zip Qt-146171c3a393b18a0345d36461c2f276d39b980f.tar.gz Qt-146171c3a393b18a0345d36461c2f276d39b980f.tar.bz2 |
Respect string converters in binding assignments
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qmlbindablevalue.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index f2cfcf8..d1835cf 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -134,6 +134,13 @@ void QmlBindableValue::update() } else { QVariant value = this->value(); + if ((uint)d->property.propertyType() >= QVariant::UserType && + value.type() == QVariant::String) { + QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(d->property.propertyType()); + if (con) + value = con(value.toString()); + } + if (d->property.propertyType() == QVariant::Url && value.canConvert(QVariant::String) && !value.isNull()) value.setValue(context()->resolvedUrl(QUrl(value.toString()))); |