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

ListView creates too many delegates on a model reset while scrolling

    XMLWordPrintable

    Details

    • Commits:
      a9559a8b84ec221550512fd7ff50f6fc5a569c59 (qt/qtdeclarative/5.12)

      Description

      If a ListView is scrolling when a model reset happens, the ListView will create a lot of extra, unnecessary delegates. These delegates are then immediately destroyed, the delegate count goes to 0, then enough delegates are recreated to show the ListView in its initial position.

      In the attached example, there's a timer that resets the model every 2 seconds, to show the effect. During ordniary scrolling the delegate count is in the 55-60 range, but when a reset happens, the delegate count jumps to over 100. Playing that game a few times I was able to hit 200, i.e. almost FOUR times the normal amount of delegates.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              peppe Giuseppe D'Angelo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes