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

Inconsistent qml view items update (GridView) on c++ model reset

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.10.0
    • None
    • MacOS, M2 Pro
    • macOS

      Issue

      Some qml view items (GridView, ListView) inconsistently update on C++ model update. Therefore, very often the view items (so the display) are not sync with model. Calling beginResetModel() and endResetModel() one after the one seems to cause the issue. 

      Reproduction

      Please find attached a minimal reproduction code. It was tested on Qt 6.10.0 built from source. 

      The code initialises a C++ model with 3 items and after 2 secs update the model to leave one 1 item. Usually at the first launch the update works correctly but after multiple app relaunches I see the list not being updated. Are you able to reproduce it ? 

      Workaround

      Adding a small delay after the beginResetModel() (10ms) always give consistent and correct updates. 

        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
            david.queruel.cox David Queruel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes