diff options
Diffstat (limited to 'src/libs/qmleditorwidgets/colorbox.cpp')
-rw-r--r-- | src/libs/qmleditorwidgets/colorbox.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libs/qmleditorwidgets/colorbox.cpp b/src/libs/qmleditorwidgets/colorbox.cpp index ad8109c27d..b0da2642e2 100644 --- a/src/libs/qmleditorwidgets/colorbox.cpp +++ b/src/libs/qmleditorwidgets/colorbox.cpp @@ -29,12 +29,10 @@ static inline QString properName(const QColor &color) { - QString s; if (color.alpha() == 255) - s.sprintf("#%02x%02x%02x", color.red(), color.green(), color.blue()); + return QString::asprintf("#%02x%02x%02x", color.red(), color.green(), color.blue()); else - s.sprintf("#%02x%02x%02x%02x", color.alpha(), color.red(), color.green(), color.blue()); - return s; + return QString::asprintf("#%02x%02x%02x%02x", color.alpha(), color.red(), color.green(), color.blue()); } static inline QColor properColor(const QString &str) |