diff options
Diffstat (limited to 'src/gui/painting/qcolor.cpp')
-rw-r--r-- | src/gui/painting/qcolor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index 269e6f2d97..56180af693 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -527,9 +527,10 @@ QString QColor::name(NameFormat format) const { switch (format) { case HexRgb: - return QString::asprintf("#%02x%02x%02x", red(), green(), blue()); + return QLatin1Char('#') + QString::number(rgba() | 0x1000000, 16).rightRef(6); case HexArgb: - return QString::asprintf("#%02x%02x%02x%02x", alpha(), red(), green(), blue()); + // it's called rgba() but it does return AARRGGBB + return QLatin1Char('#') + QString::number(rgba() | 0x100000000, 16).rightRef(8); } return QString(); } |