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

QtQuick ListView shows wrong number of rows on Windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.7.3, 6.8.0
    • None
    • Windows 10, VS 2019, Qt 6.7.3
      Windows 10, VS 2022, Qt 6.8.0
    • Windows

    Description

      We have a large tree model containing all sorts of simulation data.

      For easy access I wrote a proxy model which I set on different branches of this model. Because we have loads of role names I also filter the roles to the ones needed for the desired purpose.

      This proxy model is displayed in a QML ListView with appropriate delegate. 

      This list model shows the wrong number of rows.

      In order to track this problem down I wrote a minimal example with only a very simple model which toggles the number of rows and the roleNames in a timer.  This is done in between beginResetModel() and endResetModel(). 

      This should be a legal operation because it also occurs if I change the sourceModel() of a proxy model which is definitely a legal operation. Therefore I would expect correct display of the model data in my ListView.

      But on Windows with Qt 6.7.3 VS 2019 as well as Qt 6.8.0 with VS 2022 I get twice the number of rows as myModel.rowCount() returns. See my attached screenshot.

      Now please have a look into DummyModel.cpp (see attachment). If you un-comment line 13 (m_timer->stop) then the effect still occurs.

      But if you instead change line 16 to m_timer->singleShot(true); then the ListView suddenly shows the correct number of rows!

       

      This problem does NOT occur on Linux with Qt 6.7.2. (I don't have a newer Qt version on my linux box, sorry.)

      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
            cyril Harald Prasser
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes