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> |
||
|---|---|---|
| .. | ||
| qaction | ||
| qactiongroup | ||
| qapplication | ||
| qboxlayout | ||
| qdesktopwidget | ||
| qformlayout | ||
| qgridlayout | ||
| qlayout | ||
| qshortcut | ||
| qsizepolicy | ||
| qstackedlayout | ||
| qtooltip | ||
| qwidget | ||
| qwidget_window | ||
| qwidgetaction | ||
| qwidgetmetatype | ||
| qwidgetsvariant | ||
| qwindowcontainer | ||
| kernel.pro | ||