summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qpalette.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-05-27 15:00:26 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-06-13 15:05:32 +0200
commit4059af81d33bb1f6a7773b77d3039f2fc53fcd23 (patch)
treec0308c515ef615133d58fd821847d0707706e40a /src/gui/kernel/qpalette.cpp
parente650ea323f5d7146caa020b69d22ace437609883 (diff)
Stop using mixed enum arithmetic
It's deprecated. Port some unnamed enumerations (used only to declare constants) to constexpr integers instead. Apply qToUnderlying as needed. Task-number: QTBUG-94059 Change-Id: Ifaa64ece966ce08df40dc71ffcfa7ac038110e0b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel/qpalette.cpp')
-rw-r--r--src/gui/kernel/qpalette.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 43521e1182..b313d545a5 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -52,7 +52,7 @@ static int qt_palette_count = 1;
static constexpr QPalette::ResolveMask colorRoleOffset(QPalette::ColorGroup colorGroup)
{
- return QPalette::NColorRoles * colorGroup;
+ return qToUnderlying(QPalette::NColorRoles) * qToUnderlying(colorGroup);
}
static constexpr QPalette::ResolveMask bitPosition(QPalette::ColorGroup colorGroup,