summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qmlparser.cpp')
-rw-r--r--src/declarative/qml/qmlparser.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp
index 10eec61..c5d7092 100644
--- a/src/declarative/qml/qmlparser.cpp
+++ b/src/declarative/qml/qmlparser.cpp
@@ -276,8 +276,8 @@ QmlParser::Variant::Variant(bool v)
{
}
-QmlParser::Variant::Variant(double v)
-: t(Number), d(v)
+QmlParser::Variant::Variant(double v, const QString &asWritten)
+: t(Number), d(v), s(asWritten)
{
}
@@ -324,7 +324,10 @@ QString QmlParser::Variant::asScript() const
case Boolean:
return b?QLatin1String("true"):QLatin1String("false");
case Number:
- return QString::number(d);
+ if (s.isEmpty())
+ return QString::number(d);
+ else
+ return s;
case String:
case Script:
return s;