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

QSortFilterProxy doesn't reorder items correctly in a qml ListView anymore

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      Since Qt6.8, if I have a ListView, that displays a model passed through a QSortFilterProxy model, whenever the sort order changes, items aren't updated properly to match their position. Presumably the proxy doesn't emit the dataChanged signal for the items that got reordered? Or the layout change signals aren't processed by the ListView?

      This currently completely breaks my application on Qt6.8. I have a ListView, which shows a room list for a chat client. If any new message is sent, the room list is supposed to move the updated room to the top and while the QSortFilterProxy still does that, this isn't reflected in the UI, which makes for a very confusing UX.

      Example project is attached. If you press the "Decrement FFFF" button, it will decrement the counter for the item with the text "FFFF". This should eventually move that item down in the list. However, you can clearly see that while the count moves down, the text labels never change to reflect the item at that position.

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            deepbluev7 Nicolas Werner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes