summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstyle.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-05-04 15:38:13 +0200
committerThiago Macieira <thiago.macieira@intel.com>2020-05-07 13:23:36 +0000
commite106dfdd6b5fa118993ea8b7ff4baf00102806ca (patch)
tree94d1c298303b56711bfd7cdde1a07711a102157c /src/widgets/styles/qstyle.cpp
parent891b60bbc84ddde077072df3426539c716d47459 (diff)
Clean up some more mixed enum/int math
Add casts when necessary, and replace a bitwise trick with the proper function call. Pick-To: 5.15 Change-Id: I8b3109781af1e7fdc5d1c4c3fafe43394c81d71d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/styles/qstyle.cpp')
-rw-r--r--src/widgets/styles/qstyle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp
index 1e698028fd..e659ef5fcc 100644
--- a/src/widgets/styles/qstyle.cpp
+++ b/src/widgets/styles/qstyle.cpp
@@ -64,7 +64,7 @@ static int unpackControlTypes(QSizePolicy::ControlTypes controls, QSizePolicy::C
return 0;
// optimization: exactly one bit is set
- if ((controls & (controls - 1)) == 0) {
+ if (qPopulationCount(uint(controls)) == 1) {
array[0] = QSizePolicy::ControlType(uint(controls));
return 1;
}