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

ListView doesn't update it's contentHeight when ListView.header height changes dynamically

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.2.1
    • 5.0.0, 5.1.0 , 5.2.0 Beta1
    • None
    • f449534020adc8623ebfced5daae331ef56c4421

    Description

      Run code below. ListView.contentHeight doesn't update when the header height updates.

      import QtQuick 2.0
      
      ListView {
          model: 50
          width: 320; height: 480
          onContentHeightChanged: console.log("Content height changed to", contentHeight)
      
          delegate: Rectangle {
              width: 320; height: 50
              color: Qt.rgba(Math.random(), Math.random(), Math.random(), 1.0)
          }
          header: Rectangle {
              color: "red"
              width: 320; height: 50
              onHeightChanged: console.log("Header height changed to", height)
              Timer {
                  running: true
                  interval: 1000
                  onTriggered: {
                      console.log("Content heigh before: ", contentHeight)
                      parent.height = 100
                      console.log("Content heigh after: ", contentHeight)
                  }
              }
          }
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-24292
        # Subject Branch Project Status CR V

        Activity

          People

            martinj Martin Jones
            jpetrell Joona Petrell
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes