Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.10.0, 5.9.4
Description
QTreeView::indexRowSizeHint() is quite slow for trees with lots of columns, since it calls itemDelegate(index).sizeHint() for every index in the row. The return value from indexRowSizeHint() is cached in QTreeViewPrivate::itemHeight(), but the initial call to indexRowSizeHint() can cause a noticeable delay when scrolling to uncached rows. If this method were virtual, it would be possible to use subclass-specific implementations that could be much, much faster.
We're using PyQt to implement a tree view that typically has hundreds of columns. We've already reimplemented drawRow() to speed up painting and data fetching, and we were able to get an additional ~20% frame rate improvement when scrolling to rows with uncached heights by reimplementing indexRowSizeHint().