Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
3.x, 4.5.3, 4.6.2
-
None
Description
In QTreeViewPrivate::layout function, we have the following code :
if (model->hasChildren(parent))
{ if (model->canFetchMore(parent)) model->fetchMore(parent); count = model->rowCount(parent); }So when sort by column, the view requests to fetch more data from the model, but this is not necessary and even harmful when the model has a large amount of data and uses canFetchMore / fetchMore to provide data to the view.
As mentioned in our document for canFetchMore that "If canFetchMore() returns true, QAbstractItemView will call fetchMore(). However, the fetchMore() function is only called when the model is being populated incrementally."
So it's more reasonable that we remove these lines.
BTW, removing these lines doesn't influence the sorting function.