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

QSortFilterProxyModel: Stable sort broken on dataChanged()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 5.4.1
    • 4.3.3, 5.4.0 Beta
    • Widgets: Itemviews
    • None
    • bec1854cc023fb705319c582a636d5f484adafcc

    Description

      When setDynamicSortFilter() is set to true, then QSortFilterProxyModel resorts incorrectly when data changes on roles that are not the sort role. Changing any other role should not change the sort order.

      Take for example a two column table where DisplayRole is the
      sort role:
      a | 0
      b | 1
      b | 2
      b | 3
      z | 4

      If the row "b|2" changes it's color for some reason it is removed from the table and then re-inserted as a new row. This causes the row to go below it's "like" rows and the arragement is changed to:

      a | 0
      b | 1
      b | 3
      b | 2 (this row incorrectly moved)
      z | 4

      Attachments

        Issue Links

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

          Activity

            People

              dfaure_kdab David Faure
              sanonymous Nokia Qt Support (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes