Commit 914f12ba authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.rewriter: string fix

Change-Id: I9a46704c24bdd9ddfd24ba2cf76eb2573f1cf5ef
Reviewed-on: default avatarQt Sanity Bot <>
Reviewed-by: default avatarThomas Hartmann <>
parent bfed87f9
......@@ -54,6 +54,14 @@ inline static QString properColorName(const QColor &color)
return s;
inline static QString doubleToString(double d)
QString string = QString::number(d, 'f', 3);
if (string.endsWith(".000"))
return string;
QmlTextGenerator::QmlTextGenerator(const QStringList &propertyOrder, int indentDepth):
......@@ -116,7 +124,7 @@ QString QmlTextGenerator::toQml(const AbstractProperty &property, int indentDept
return QString(QLatin1String("\"%1\"")).arg(properColorName(value.value<QColor>()));
case QVariant::Double:
return QString::number(value.toDouble(), 'f', 3);
return doubleToString(value.toDouble());
case QVariant::Int:
case QVariant::LongLong:
case QVariant::UInt:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment