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

QML ListView's currentIndex and currentItem are not updated properly

    XMLWordPrintable

Details

    Description

      When inserting list elements at the beginning of the model, currentItem and currentIndex are not updated, so we have an invalid state where currentItem is still pointing to previous one, but as we are adding elements at the beginning, both properties should be updated.

      Redefining the currentIndex after updating the model, fixes the issue. The small attached QML example shows the issue and the workaround to fix it.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            cidorvan Cidorvan Leite
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes