Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
4.8.6, 5.7.0
-
None
-
Windows 7, 64 bit
-
Bug Fixing Week Q2/2020
Description
If programmatically select not consecutive rows in a very big tableview, for example, every 2nd row, all drawing become too slow.
The reason is that when horizontal QHeaderView is repainting the function QItemSelectionModel::isColumnSelected is called.
The code complexity is O(N^2) (rows x joined.size() = VERY large number):
https://github.com/qt/qtbase/blob/e400b7e326c554ccd819448866265953d2a0f24d/src/corelib/itemmodels/qitemselectionmodel.cpp#L1578
See the difference if set horizontal header view to hidden:
all is done in a fraction of a second instead of seconds.
The current workaround is to draw custom header without the N^2 code above.