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

ListView attached properties for sections do not work at all

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.4.1
    • None
    • Any

    Description

      The following code:

      ApplicationWindow {
          visible: true
      
          ListView {
              anchors.fill: parent
      
              model: ListModel {
                  ListElement { name: "A"}
                  ListElement { name: "B"}
                  ListElement { name: "C"}
                  ListElement { name: "D"}
                  ListElement { name: "E"}
              }
      
              delegate: Text {
                  text: model.name
              }
      
              section.property: "name"
              section.delegate: Text {
                  text: section
                  Component.onCompleted: {
                      console.log("section (attached):", ListView.section)
                      console.log("previous section (attached):", ListView.previousSection)
                      console.log("next section (attached):", ListView.nextSection)
                      console.log("section:", section) // the only valid line
                      console.log("previous section:", previousSection)
                      console.log("next section:", nextSection)
                  }
              }
          }
      }
      
      

      only displays valid console output for:
      console.log("section:", section)

      The attached project contains a version which uses a TableView instead - that doesn't work either.
      Checked for dekstop (Windows) and mobile (Android).

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              ddobrev Dimitar Dobrev
              Votes:
              8 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes