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

ListView not refreshed after invalidateFilter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.2.0, 5.5.1
    • None

      I have a QML ListView, which has a custom QSortFilterProxyModel as a model, which has a custom filterAcceptsRow() that can either show all elements or show some elements.
      When the filter changes I emit the invalidateFilter() signal to refresh the view, but the view is refreshed wrong: some elements are unsorted, missing or even blank (the delegate isn't painted).
      If I scroll up or down and back to the original position the view shows fine, so I think everything works fine except the refreshing of the view after the invalidateFilter() signal is emitted.

      I wrote an example code to reproduce the problem. Sometimes you have to scroll up & down and filter on/off a couple of times to reproduce it.
      This sample code outputs some warnings that my project doesn't, but they didn't help me find the issue.

      My system is an ArchLinux 64 bits with the lastest version of Qt available (version 5.2.0-2).

        1. sample1.png
          sample1.png
          21 kB
        2. sample2.png
          sample2.png
          39 kB
        3. test.tar.bz2
          14 kB
        4. demo.ogv
          1.35 MB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            aalpert Alan Alpert
            aykon aykon
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes