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

QSortFilterProxyModel sorting problem

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.6.1
    • Widgets: Itemviews
    • None
    • Linux 64bit
    • 7b96944a02991e404cdab61e24182b90f5849120

    Description

      If QSortFilterProxyModel is used to sort items in some cases the sorting may not work.
      If on "startup" all items are hidden with filterAcceptsRow and we are sorting the list using dynamicSortFilter (lessThan) then when some items become available again the sort will not work because lessThan isn't called. The problem is that update_source_sort_column() in QSortFilterProxyModel isn't called when one or more items become visible so the source_sort_column is -1 in QSortFilterProxyModelPrivate::_q_sourceDataChanged.

      I've attached test program, the items are shown after 5 seconds and should be sorted but aren't, if I set mVisible to true in TreeModel then all is ok.

      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)
            kedge Roman Jarosz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes