qt5base-lts/tests/auto/widgets/kernel/qsizepolicy
Marc Mutz 8b9b27bced QSizePolicy: add a transposed() method
In some situations, this allows for nicer code. It's also possible to
make this constexpr in C++11, whereas the mutable transpose() would
require C++14-style constexpr.

The new function should also be faster, since it just swaps the member
variables.

Because of constexpr-function limitations, the way the return value is
constructed needs to depend on the level of the compiler's C++11 support.
This is not the only class that requires uniform init to provide a fully
constexpr interface (QUuid and QBasicAtomic come to mind), so this should
probably be generalized across Qt at some point.

Added tests.

[ChangeLog][QtWidgets][QSizePolicy] Added transposed() method.

Change-Id: Ic1077a0d5a861e7c63bd1daeeb42b97c3a2f71ef
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
2017-01-28 07:46:27 +00:00
..
qsizepolicy.pro QSizePolicy: add some constexpr 2017-01-28 07:46:22 +00:00
tst_qsizepolicy.cpp QSizePolicy: add a transposed() method 2017-01-28 07:46:27 +00:00