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

ListView ContentItem Children Invalid

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0 RC
    • None
    • Windows

    Description

       

      The contentItem.children property of a ListView does not contain the correct amount of elements. It appears to only add the very first added element and ignore all others.

       

      import QtQuick
      import QtQuick.Controls
      ApplicationWindow {
          visible: true
          width: 400
          height: 400
          ListView {
              id: listView
              anchors.fill: parent
              spacing: 10
              model: 10
              delegate: Rectangle {
                  objectName: "MyRect" + index
                  height: 50
                  color: "lightblue"
                  Text {
                      anchors.centerIn: parent
                      text: "Item " + index
                  }
              }
              Component.onCompleted: {
                  console.log(contentItem.children);
              }
          }
      }
      

       

      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
            kidsault kidsault
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes