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

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

    XMLWordPrintable

Details

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

    Description

      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.

       

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes