diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-01-16 11:18:21 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-01-17 11:16:17 +0100 |
commit | a3b2eac380bcd7d787e8fcc92a27bd7ed4f80b55 (patch) | |
tree | 4a157e43107bada6525de823c99a598651bb28da | |
parent | 5dc16d132497b54af608126ecf92f9e064c5aaf1 (diff) |
QColor: add casts to ushort
Silence lossy conversion warnings on MSVC.
Task-number: QTBUG-80997
Change-Id: I0e5778b9f20b599de6fc8894c4b98fbc1b1510b9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/gui/painting/qcolor.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index f0d7dd23ad..0189f4e5f1 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -72,10 +72,10 @@ public: QColor(Qt::GlobalColor color) noexcept; Q_DECL_CONSTEXPR QColor(int r, int g, int b, int a = 255) noexcept : cspec(isRgbaValid(r, g, b, a) ? Rgb : Invalid), - ct(cspec == Rgb ? a * 0x0101 : 0, - cspec == Rgb ? r * 0x0101 : 0, - cspec == Rgb ? g * 0x0101 : 0, - cspec == Rgb ? b * 0x0101 : 0, + ct(ushort(cspec == Rgb ? a * 0x0101 : 0), + ushort(cspec == Rgb ? r * 0x0101 : 0), + ushort(cspec == Rgb ? g * 0x0101 : 0), + ushort(cspec == Rgb ? b * 0x0101 : 0), 0) {} QColor(QRgb rgb) noexcept; QColor(QRgba64 rgba64) noexcept; |