diff options
author | ChunLin Wang <wangchunlin@uniontech.com> | 2021-08-26 21:15:31 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-01 17:06:53 +0000 |
commit | 8ec406b2296abdbdc8606fa955a2f8feb5254b1f (patch) | |
tree | 41abf5671308a58b6b9e5d7177b3afd58417e76d /tests/auto/widgets/itemviews/qlistview/.gitignore | |
parent | 561ba60ea436c06f7aa88ae9c8a847f851851112 (diff) |
Fix QListView assert when the last row is moved in IconModev6.2.0-beta4
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
Change-Id: I36419be5459b8ced930c619f538482ea1db4ad03
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ca69e5aeef2fef540e687475ac00a4f332fdc5f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/auto/widgets/itemviews/qlistview/.gitignore')
0 files changed, 0 insertions, 0 deletions