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

ListView can go out of sync with the model if item is removed and inserted outside of the view before the current item

XMLWordPrintable

    • 2d8033a4ffb9ca60adee29d375491d7ed2a82747
    • Bug Fixing Candidates

      To reproduce with attached project:

      • press Right arrow until you get to the end of the list
      • press Enter
        -> currentIndex == count
      • press Enter again
        -> currentIndex > count and highlight is gone

      It looks like removing action doesn't update the currentIndex properly. On a quick look, it looks like currentChanges in QQuickItemView is not reset() before new changes are added so it skips updating newCurrentIndex variable and thus it thinks the remove actually happens in front, not behind, of the actual current index.

      If the removed item was visible (either on screen or due to cacheBuffers), it works fine.

        1. qtbug92809.zip
          2 kB
          Joni Poikelin
        2. main_bad_count.qml
          3 kB
          Anthony Groyer
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            tonyl Tony Leinonen
            poikelin Joni Poikelin
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes