qt6-bb10/tests/auto/widgets/itemviews
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
..
qabstractitemview tests: blacklist tst_QIV::focusNextOnHide() on Wayland 2024-03-14 14:50:35 +01:00
qcolumnview Change license for tests files 2024-02-04 09:56:42 +01:00
qdatawidgetmapper Change license for tests files 2024-02-04 09:56:42 +01:00
qfileiconprovider Change license for tests files 2024-02-04 09:56:42 +01:00
qheaderview Change license for tests files 2024-02-04 09:56:42 +01:00
qitemdelegate Change license for tests files 2024-02-04 09:56:42 +01:00
qitemeditorfactory Change license for tests files 2024-02-04 09:56:42 +01:00
qitemview Change license for tests files 2024-02-04 09:56:42 +01:00
qlistview Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qlistwidget Change license for tests files 2024-02-04 09:56:42 +01:00
qtableview QTableView: fix infinite loop when resizing rows/columns on model reset 2024-04-17 04:38:33 +02:00
qtablewidget Change license for tests files 2024-02-04 09:56:42 +01:00
qtreeview Change license for tests files 2024-02-04 09:56:42 +01:00
qtreewidget Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qtreewidgetitemiterator Change license for tests files 2024-02-04 09:56:42 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00