qt6-bb10/tests/auto/widgets/kernel
Jan Arve Saether 9f96bf2023 Fix a regression with regards to hfw behavior in QStackedWidget
This is a regression because we made QStackedWidget actually
support heightForWidth in 4.8. This was done with change
4780f94e391b5e881497c5228661dead42c821fa.

The problem was that heightForWidth was not calculated correctly
because some of the pages were hidden. The hidden pages were
actually not contributing to the hfw of the QStackedWidget at all.
This again caused the QStackedWidget to change its heightForWidth()
value when the current tab changed, which again could cause "jumps"
in the UI when switching tabs (as demonstrated in the task).

The problem was that the patch relied on calling
QWidgetItem::heightForWidth(), and this function would return -1
if the widget was hidden. However, QWidget::heightForWidth() does
not have this magic and returns the proper hfw value regardless
of its visibility.

One could argue about the correctness of this patch, but since
QStackedLayout::sizeHint() disregards QWidgetItem::sizeHint() (it
asks the widget directly), we do the same in
QStackedLayoutHFW::heightForWidth() for consistency.

In addition, QStackedLayout enforces that only widgets can be added
to it, and you cannot add your own QLayoutItem subclasses to it:

  qWarning("QStackedLayout::addItem: Only widgets can be added");

Task-id: QTBUG-24758

Change-Id: I349cf8f4215e4581ea237ef773d53dcdf3db176b
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2012-10-10 14:22:58 +02:00
..
qaction Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qactiongroup Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qapplication Mac: Bring back "Text boxes and list only" tab navigation 2012-10-10 13:15:57 +02:00
qboxlayout Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qdesktopwidget Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qformlayout Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qgridlayout Remove CDE and Motif styles from qtbase 2012-09-27 15:16:16 +02:00
qlayout Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qshortcut Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qsizepolicy Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qstackedlayout Fix a regression with regards to hfw behavior in QStackedWidget 2012-10-10 14:22:58 +02:00
qtooltip Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qwidget QXcbWindow: Don't recreate window when reparenting. 2012-10-01 15:48:08 +02:00
qwidget_window Fix drag and drop with native widgets 2012-09-27 23:51:30 +02:00
qwidgetaction Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qwidgetmetatype Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qwidgetsvariant Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
kernel.pro Store the QMetaObject with the QMetaType. 2012-07-01 15:07:10 +02:00