From 12b9a6c43c13584fe5e419dd318903b5ef500c53 Mon Sep 17 00:00:00 2001 From: Alexander Arin Date: Tue, 7 Apr 2020 13:46:27 +0300 Subject: [PATCH] Build for Q 5.1 - 5.5 fixed QString :: asprint is missing in Qt 5.1 - Qt 5.5 --- src/xlsx/xlsxcolor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xlsx/xlsxcolor.cpp b/src/xlsx/xlsxcolor.cpp index a3e59db..3f47b9e 100644 --- a/src/xlsx/xlsxcolor.cpp +++ b/src/xlsx/xlsxcolor.cpp @@ -131,7 +131,12 @@ QColor XlsxColor::fromARGBString(const QString &c) QString XlsxColor::toARGBString(const QColor &c) { - return QString::asprintf("%02X%02X%02X%02X", c.alpha(), c.red(), c.green(), c.blue()); + return QString("%1%2%3%4") + .arg(c.alpha(), 2, 16, QLatin1Char('0')) + .arg(c.red(), 2, 16,QLatin1Char('0')) + .arg(c.green(), 2, 16, QLatin1Char('0')) + .arg(c.blue(), 2, 16, QLatin1Char('0')) + .toUpper(); } #if !defined(QT_NO_DATASTREAM)