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

QSortFilterProxyModel: Stable sort broken on dataChanged()

XMLWordPrintable

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

      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

        For Gerrit Dashboard: QTBUG-1548
        # Subject Branch Project Status CR V

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

              Created:
              Updated:

                There are no open Gerrit changes