qt5base-lts/tests/auto
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
..
cmake CMake: Improve QT5_GET_MOC_FLAGS macro 2012-10-04 11:58:48 +02:00
compilerwarnings/data Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
concurrent Include qexception.h instead of qtconcurrentexception.h 2012-09-28 23:50:10 +02:00
corelib QTextBoundaryFinder: Introduce BoundaryReason::MandatoryBreak flag 2012-10-10 13:26:13 +02:00
dbus Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
gui Invalidate old QImage data if load()/loadFromData() has failed 2012-10-10 13:24:23 +02:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
network typo fixed in tst_QLocalSocket::verifyListenWithDescriptor_data 2012-10-02 08:06:11 +02:00
opengl Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
other Fix #if 0 usage in collections autotest. 2012-10-04 03:03:17 +02:00
printsupport QtPrintSupport: allow slight deviations from pre-defined paper sizes in tests 2012-09-26 10:08:59 +02:00
shared Auto tests: add PlatformClipboard::isAvailable() 2012-09-27 06:07:13 +02:00
sql QSqlQuery::value string overload 2012-10-08 08:55:28 +02:00
testlib Make QUrl::errorString() usable for QtTest output in invalid URLs 2012-10-02 22:34:42 +02:00
tools Use jom in tst_qmake. 2012-10-08 08:46:21 +02:00
widgets Fix a regression with regards to hfw behavior in QStackedWidget 2012-10-10 14:22:58 +02:00
xml Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
auto.pro Test: Redo remove QSKIP from printsupport tests 2012-09-13 19:33:08 +02:00
network-settings.h Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
platformquirks.h Auto tests: remove PlatformQuirks::isAutoMaximizing() 2012-09-26 10:08:59 +02:00
test.pl Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00