Skip to content
Snippets Groups Projects
Commit 73d119f3 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: fix regression in string rewriting


A regression was triggered by testGradientsRewriter().
Trailing "0" are not nice.

Change-Id: I0243ee8250c98cd5742b79af0d0cfef74357b074
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 79ca107a
No related branches found
No related tags found
No related merge requests found
......@@ -55,8 +55,12 @@ inline static QString properColorName(const QColor &color)
inline static QString doubleToString(double d)
{
QString string = QString::number(d, 'f', 3);
if (string.endsWith(".000"))
string.chop(4);
if (string.contains(QLatin1Char('.'))) {
while (string.at(string.length()- 1) == QLatin1Char('0'))
string.chop(1);
if (string.at(string.length()- 1) == QLatin1Char('.'))
string.chop(1);
}
return string;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment