qt6-bb10/tests/auto/widgets
Volker Hilsheimer 960867566a QTableView: fix infinite loop when resizing rows/columns on model reset
When a slot is connected to the modelReset signal before the model is
set on the view, then such a slot might try to resize the columns or
rows to fit the contents before the view had a chance to perform layout
work.

In that case, the while-loop that calculated the size hint of a rows
(or column) by checking the size hint of each cell might not exit, as
cached information about visual indexes would be invalid.

To prevent this, don't loop over the cells if the actual last row/column
of the model (after the reset) is less than the first (cached) visible
row/column. Also, make sure we increase the counter for number of
rows/columns processed with each iteration.

Add a test (that loops infinitely without the fix, resulting in the
test being killed by the framework), and make the 'actual' variables
constant for clarity.

Fixes: QTBUG-124301
Pick-to: 6.7
Change-Id: I0adb2f1e8a1e78760ef7c19e9686c9572eca8be6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-17 04:38:33 +02:00
..
dialogs Tests: check the output of QFile::open 2024-03-27 04:24:11 +01:00
effects Change license for tests files 2024-02-04 09:56:42 +01:00
graphicsview Remove extra semi-colons 2024-02-06 20:17:18 +09:00
itemviews QTableView: fix infinite loop when resizing rows/columns on model reset 2024-04-17 04:38:33 +02:00
kernel Android: blacklist tst_QWidget::setParentChangesFocus 2024-04-12 20:12:18 +03:00
styles Change license for tests files 2024-02-04 09:56:42 +01:00
util Change license for tests files 2024-02-04 09:56:42 +01:00
widgets QToolButton: Don't crash if deleted while in event handler 2024-04-11 03:35:10 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00