diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-13 02:26:30 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-13 02:26:45 (GMT) |
commit | 57e0665cb997046389066bd2d2b26a30c367ece8 (patch) | |
tree | e73b0bc85608a8bd902bc682beece9659d1c2fe7 /src/declarative/qml/qmlparser.cpp | |
parent | c87665193a9198168e6e42978833ce6c96ae184d (diff) | |
download | Qt-57e0665cb997046389066bd2d2b26a30c367ece8.zip Qt-57e0665cb997046389066bd2d2b26a30c367ece8.tar.gz Qt-57e0665cb997046389066bd2d2b26a30c367ece8.tar.bz2 |
Fix qmlparser test failure
Diffstat (limited to 'src/declarative/qml/qmlparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlparser.cpp | 9 |
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; |