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>bb10
parent
891b60bbc8
commit
e106dfdd6b
|
|
@ -103,11 +103,11 @@ public:
|
|||
|
||||
inline void setDefaultSpacing(Qt::Orientation o, qreal spacing){
|
||||
if (spacing >= 0)
|
||||
m_defaultSpacing[o - 1] = spacing;
|
||||
m_defaultSpacing[int(o) - 1] = spacing;
|
||||
}
|
||||
|
||||
inline qreal defaultSpacing(Qt::Orientation o) const {
|
||||
return m_defaultSpacing[o - 1];
|
||||
return m_defaultSpacing[int(o) - 1];
|
||||
}
|
||||
|
||||
inline qreal perItemSpacing(QSizePolicy::ControlType control1,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue