QSizePolicy: prepare for constexpr'ifcation

...by bringing expandingDirections() into a (C++11) constexpr'able form.

Change-Id: I1922329a6f579df2b3504c8ae048224f9b229d6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2014-12-26 21:12:48 +01:00
parent bac0796308
commit 5b720fbf5d

View File

@ -101,12 +101,8 @@ public:
void setControlType(ControlType type);
Qt::Orientations expandingDirections() const {
Qt::Orientations result;
if (verticalPolicy() & ExpandFlag)
result |= Qt::Vertical;
if (horizontalPolicy() & ExpandFlag)
result |= Qt::Horizontal;
return result;
return ( (verticalPolicy() & ExpandFlag) ? Qt::Vertical : Qt::Orientations() )
| ( (horizontalPolicy() & ExpandFlag) ? Qt::Horizontal : Qt::Orientations() ) ;
}
void setHeightForWidth(bool b) { bits.hfw = b; }