summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativestringconverters.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qdeclarativestringconverters.cpp')
-rw-r--r--src/declarative/qml/qdeclarativestringconverters.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativestringconverters.cpp b/src/declarative/qml/qdeclarativestringconverters.cpp
index 5c88b9a..bbcc00b 100644
--- a/src/declarative/qml/qdeclarativestringconverters.cpp
+++ b/src/declarative/qml/qdeclarativestringconverters.cpp
@@ -82,10 +82,6 @@ QVariant QDeclarativeStringConverters::variantFromString(const QString &s)
{
if (s.isEmpty())
return QVariant(s);
- if (s.startsWith(QLatin1Char('\'')) && s.endsWith(QLatin1Char('\''))) {
- QString data = s.mid(1, s.length() - 2);
- return QVariant(data);
- }
bool ok = false;
QRectF r = rectFFromString(s, &ok);
if (ok) return QVariant(r);
@@ -104,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: