diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-08 07:21:40 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-08 07:23:01 (GMT) |
commit | be8a7153d613586d69ac528153a6b8ccbe931aa6 (patch) | |
tree | 56faa5dbcce91cbf6557c2f4187f583a8ffc5491 /src/declarative | |
parent | 3baf285917e2ea3183866768807f2495010602ab (diff) | |
download | Qt-be8a7153d613586d69ac528153a6b8ccbe931aa6.zip Qt-be8a7153d613586d69ac528153a6b8ccbe931aa6.tar.gz Qt-be8a7153d613586d69ac528153a6b8ccbe931aa6.tar.bz2 |
Make string -> int conversion consistent in bindings
QTBUG-9538
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/qdeclarativestringconverters.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp index c0f8338..bbcc00b 100644 --- a/src/declarative/qml/qdeclarativestringconverters.cpp +++ b/src/declarative/qml/qdeclarativestringconverters.cpp @@ -100,6 +100,10 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s) QVariant QDeclarativeStringConverters::variantFromString(const QString &s, int preferredType, bool *ok) { switch (preferredType) { + case QMetaType::Int: + return QVariant(int(qRound(s.toDouble(ok)))); + case QMetaType::UInt: + return QVariant(uint(qRound(s.toDouble(ok)))); case QMetaType::QColor: return QVariant::fromValue(colorFromString(s, ok)); case QMetaType::QDate: |