qt6-bb10/tests/auto/widgets
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
..
dialogs Fix compiler warnings from QKeyCombination 2020-09-28 17:23:20 +02:00
effects CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
graphicsview CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
itemviews QTreeView: fetch as many nested entries as fit into the view 2020-10-02 13:16:12 +02:00
kernel tests/xcb: fix tst_QWidget::updateWhileMinimized() - again 2020-09-29 07:28:58 +00:00
styles CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
util CMake: Regenerate projects to use new qt_internal_ API 2020-09-23 16:59:06 +02:00
widgets Re-enable a QDateTimeEdit right-to-left test of its sectionText() 2020-09-30 16:40:43 +02:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00
widgets.pro