Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8889

Add support for restoring expansion in QTreeView

    XMLWordPrintable

Details

    • Task
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • None
    • Widgets: Itemviews
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes