qt5base-lts/tests/auto/widgets/itemviews
ChunLin Wang ca69e5aeef Fix QListView assert when the last row is moved in IconMode
After the last row is moved, 0 will be returned when obtaining
row and column data. At this time, QListView::doitemslayout will
not call d->doitemslayout, so the QBspTree data structure will
not be cleaned up, leaving a stale tree structure behind. This
will trigger an assert during paintEvent handling if QListView is
set to IconMode

In QListView::ListMode the test for a valid model index doesn't
use an assert.

Call QListViewPrivate::clear explicitly if the column count is 0
so that the QBspTree and other data structures are cleared.

Add a test case that simulates this scenario by implementing a
model that returns a 0 column count for an index after the model
structure was changed through a move of rows.

Done-with: Volker Hilsheimer
Fixes: QTBUG-95463
Pick-to: 5.15 6.1 6.2
Change-Id: I36419be5459b8ced930c619f538482ea1db4ad03
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-09-01 16:03:15 +00:00
..
qabstractitemview testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
qcolumnview Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdatawidgetmapper Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfileiconprovider Verify that QFileIconProvider returns valid pixmaps 2021-02-23 15:34:05 +01:00
qheaderview Remove the qmake project files 2021-01-07 15:32:28 +01:00
qitemdelegate QAbstractItemView: don't toggle extended selection on Ctrl+Press 2021-06-07 20:23:17 +02:00
qitemeditorfactory Remove the qmake project files 2021-01-07 15:32:28 +01:00
qitemview Remove the qmake project files 2021-01-07 15:32:28 +01:00
qlistview Fix QListView assert when the last row is moved in IconMode 2021-09-01 16:03:15 +00:00
qlistwidget emit layoutAboutToBeChanged timely 2021-07-20 21:27:27 +01:00
qtableview QTableView: fix selection with rows and cells in ExtendedSelection mode 2021-07-12 08:19:16 +00:00
qtablewidget emit layoutAboutToBeChanged timely 2021-07-20 21:27:27 +01:00
qtreeview Prefer QFAIL("Informative message") over QVERIFY(false) 2021-06-14 15:57:16 +02:00
qtreewidget emit layoutAboutToBeChanged timely 2021-07-20 21:27:27 +01:00
qtreewidgetitemiterator Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt CMake: Regenerate subdir test projects 2020-07-09 09:38:39 +02:00