qt5base-lts/tests/auto/widgets/itemviews
Volker Hilsheimer e74af68654 QTreeView: fetch as many nested entries as fit into the view
QAbstractItemModel::canFetchMore and fetchMore implementations might only
add a few rows to the model each time they are called. The item views don't
generally expect that, and don't call fetchMore repeatedly, even if there
would be room in the itemview for more data. This problem cannot be
generally solved for all item views, as it would require in repeated expensive
laying out of items.

For nested indexes in a treeview however, we can try to fetch enough child
rows to populate the screen when the item is laid out by repeatedly
calling canFetchMore and fetchMore. To calculate how many items have space,
apply the same heuristics as in the scrollContentsBy implementation to
guess the number of items that can fit into the viewport.

Created test case for the fix.

Done-with: Doris Verria <doris.verria@qt.io>
Fixes: QTBUG-85366
Pick-to: 5.15
Change-Id: I54f95552993873dd4cba80b0f70f4db9d98ddc1d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-10-02 13:16:12 +02:00
..
qabstractitemview CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qcolumnview CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qdatawidgetmapper CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qfileiconprovider CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qheaderview CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qitemdelegate CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qitemeditorfactory CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qitemview CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qlistview CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qlistwidget CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qtableview Fix compiler warnings from QKeyCombination 2020-09-28 17:23:20 +02:00
qtablewidget CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qtreeview QTreeView: fetch as many nested entries as fit into the view 2020-10-02 13:16:12 +02:00
qtreewidget CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
qtreewidgetitemiterator CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
CMakeLists.txt CMake: Regenerate subdir test projects 2020-07-09 09:38:39 +02:00
itemviews.pro Remove the deprecated QDirModel 2020-06-04 19:11:19 +02:00