From d41772626b7d85e74b91f702c22308421f7ac3f7 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 18 Jun 2009 15:34:54 +1000 Subject: Use custom string converter in writeValueProperty() Reviewed-by: Aaron Kennedy --- src/declarative/qml/qmlmetaproperty.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index a152807..52036c2 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -814,6 +814,16 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) default: + { + if ((uint)t >= QVariant::UserType && vt == QVariant::String) { + QmlMetaType::StringConverter con = QmlMetaType::customStringConverter(t); + if (con) { + QVariant v = con(value.toString()); + prop.write(object, v); + return; + } + } + } break; } prop.write(object, value); -- cgit v0.12