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

ListView constantly recreates delegates with negative size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.5.10, 6.8.4
    • None
    • Issue found in macOS.

      With negative sized delegates a ListView can get stuck recreating the delegates.
      Code to reproduce the issue:

      import QtQuick
      
      Window {
          id: win
          width: 640
          height: 480
          visible: true
      
          property real delegateHeight: -30
          property int delegateCount: 10
      
          ListView {
              width: 100
              height: parent.height
              model: win.delegateCount
              delegate: Rectangle {
                  id: delegateItem
                  width: 100
                  height: win.delegateHeight
      
                  Component.onCompleted: {
                      print("Delegate created", delegateItem)
                  }
                  Component.onDestruction: {
                      print("Delegate destroyed", delegateItem)
                  }
              }
          }
      }
      

      It looks like maybe the total (negative) size of the delegates matter. E.g. in the above example "delegateHeight: -29" does not result in the loop.

        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
            lasse.lopperi Lasse Lopperi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes