diff options
Diffstat (limited to 'src/svg/qsvggenerator.cpp')
-rw-r--r-- | src/svg/qsvggenerator.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/svg/qsvggenerator.cpp b/src/svg/qsvggenerator.cpp index f19be78..5829a1a 100644 --- a/src/svg/qsvggenerator.cpp +++ b/src/svg/qsvggenerator.cpp @@ -284,12 +284,8 @@ public: } } - for (QGradientStop stop : qAsConst(stops)) { - QString color = - QString::fromLatin1("#%1%2%3") - .arg(stop.second.red(), 2, 16, QLatin1Char('0')) - .arg(stop.second.green(), 2, 16, QLatin1Char('0')) - .arg(stop.second.blue(), 2, 16, QLatin1Char('0')); + for (const QGradientStop &stop : qAsConst(stops)) { + const QString color = stop.second.name(QColor::HexRgb); str << QLatin1String(" <stop offset=\"")<< stop.first << QLatin1String("\" ") << QLatin1String("stop-color=\"") << color << QLatin1String("\" ") << QLatin1String("stop-opacity=\"") << stop.second.alphaF() <<QLatin1String("\" />\n"); |