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

Details

    • 2d8033a4ffb9ca60adee29d375491d7ed2a82747
    • Bug Fixing Candidates

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: