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

ListView: currentItem stays null if model gets update during delegate creation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.12.7, 5.12.9
    • None
    • Ubuntu 18.04
    • Linux/Other display system

      If model inherited from QAbstractItemModel gets update at the time ListView is creating delegates, then ListView becomes into inconsistent state:

      •  the view position is set somewhere in the middle, while expected expect position at the beginning;
      • currentItem stays null though currentIndex was changed, while expected valid object for currentItem.

      To reproduce the issue launch attached example ListViewWithoutCurrentItem.zip.
      ACTUAL: window is red, highlighted item is out of view bounds, window's title and logs report that currentItem is null.
      EXPECTED: window is green, view is positioned at the first item, the item is highlighted, title reports currentItem's text.

      NOTE: This bug only occurs if delegates are created asynchronously and QAbstractItemModel-inherited model gets update during delegate creation.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            asuslenn Andrey Suslennikov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes