Details
-
Task
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
None
-
None
Description
For our tree views, we want to be able to maintain the state of expanded items, even after the model and view are reset (causing the QTreeView to lose this information). A solution to this issue is to store the information about an index's expanded state on the internal representation within the model itself, then reapply it after the model and view have been reset. This presents a significant performance problem, however, because it involves arbitrarily many calls (up to the total number of items within the tree) to expand() for each individual index. There doesn't appear to be appropriate exposed API to allow a more large-scale modification of expansion (say passing a QModelIndexList of items to be expanded or collapsed) so this issue continues to be a problem even if expandAll() can be made very fast.