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

QHeaderView::restoreState() does not restore natural, unsorted order

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.15.0
    • Widgets: Itemviews
    • None
    • All

      The QHeaderView::restoreState() function does not unset an existing sort indicator if the state to restored has a sorted logical index of -1. A workaround to this problem is to call the restore function as follows:

      header()->setSortIndicator(-1, Qt::AscendingOrder)
      header()->restoreState(state);

      This ensures the sort indicator is effectively reset and relies on the state to set it again or ignore the setting. Not doing this results in the current sort indicator to persist after a state restore, which seems undesirable to me.

       

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            droidmonkey Jonathan White
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes