diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-02-25 20:11:32 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-02-27 21:16:04 +0000 |
commit | bc641ad9f8ba3ea65dc400aa2f6520b4a5d5434d (patch) | |
tree | a836825226d9a9cb6103bbf9e50454a1c5138c3e /src/widgets/kernel/qsizepolicy.h | |
parent | 2b2fefb336df7d45d3270e65088faef0ed19c308 (diff) |
QSizePolicy: simplify implementation
Even though we revoke its Q_COMPILER_UNIFORM_INIT for certain bugs
that affect existing usage in Qt, it turns out that MSVC 2013 supports
enough of braced initialization to make the macro magic in
Bits::transformed() moot.
Change-Id: I824d7fa298a2b95b4ad45c9e259e91c5ececfc0c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/kernel/qsizepolicy.h')
-rw-r--r-- | src/widgets/kernel/qsizepolicy.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h index 2235082f17..e19770cf92 100644 --- a/src/widgets/kernel/qsizepolicy.h +++ b/src/widgets/kernel/qsizepolicy.h @@ -51,10 +51,6 @@ QT_BEGIN_NAMESPACE # define QT_SIZEPOLICY_CONSTEXPR Q_DECL_CONSTEXPR # if defined(Q_COMPILER_UNIFORM_INIT) # define QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT Q_DECL_CONSTEXPR -# if defined(Q_COMPILER_CONSTEXPR) -# define QT_SIZEPOLICY_RETURN_BITS(E1, E2, E3, E4, E5, E6, E7, E8) \ - return Bits{ E1, E2, E3, E4, E5, E6, E7, E8 } -# endif // constexpr && uniform-init # endif // uniform-init #endif @@ -64,10 +60,6 @@ QT_BEGIN_NAMESPACE #ifndef QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT # define QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT #endif -#ifndef QT_SIZEPOLICY_RETURN_BITS -# define QT_SIZEPOLICY_RETURN_BITS(E1, E2, E3, E4, E5, E6, E7, E8) \ - const Bits result = { E1, E2, E3, E4, E5, E6, E7, E8 }; return result -#endif class QVariant; class QSizePolicy; @@ -198,14 +190,14 @@ private: QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT Bits transposed() const Q_DECL_NOTHROW { - QT_SIZEPOLICY_RETURN_BITS(verStretch, // \ swap - horStretch, // / - verPolicy, // \ swap - horPolicy, // / - ctype, - hfw, // \ don't swap (historic behavior) - wfh, // / - retainSizeWhenHidden); + return {verStretch, // \ swap + horStretch, // / + verPolicy, // \ swap + horPolicy, // / + ctype, + hfw, // \ don't swap (historic behavior) + wfh, // / + retainSizeWhenHidden}; } }; union { @@ -234,7 +226,6 @@ Q_WIDGETS_EXPORT QDebug operator<<(QDebug dbg, const QSizePolicy &); #undef QT_SIZEPOLICY_CONSTEXPR #undef QT_SIZEPOLICY_CONSTEXPR_AND_UNIFORM_INIT -#undef QT_SIZEPOLICY_RETURN_BITS QT_END_NAMESPACE |