diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h index 24db99354b..5e948175f3 100644 --- a/src/widgets/kernel/qsizepolicy.h +++ b/src/widgets/kernel/qsizepolicy.h @@ -108,9 +108,10 @@ public: constexpr void setVerticalPolicy(Policy d) noexcept { bits.verPolicy = d; } void setControlType(ControlType type) noexcept; + // ### Qt 7: consider making Policy a QFlags and removing these casts constexpr Qt::Orientations expandingDirections() const noexcept { - return ( (verticalPolicy() & int(ExpandFlag)) ? Qt::Vertical : Qt::Orientations() ) - | ( (horizontalPolicy() & int(ExpandFlag)) ? Qt::Horizontal : Qt::Orientations() ) ; + return ( (verticalPolicy() & static_cast(ExpandFlag)) ? Qt::Vertical : Qt::Orientations() ) + | ( (horizontalPolicy() & static_cast(ExpandFlag)) ? Qt::Horizontal : Qt::Orientations() ) ; } constexpr void setHeightForWidth(bool b) noexcept { bits.hfw = b; }