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

REG: ScrollView content size broken

    XMLWordPrintable

Details

    • 9e0dd093b (dev), ebeda378f (6.7), dbff24f50 (6.6), 3e474060d (tqtc/lts-6.5)

    Description

      ScrollView should automatically adjust to content height when it contains just a single child, see https://doc.qt.io/qt-6/qml-qtquick-controls-scrollview.html#sizing

      This code works with Qt 6.4.3, 6.5.1 and 6.6.0 but not anymore with 6.6.1 or dev.

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("ScrollView contentHeight test")
          ScrollView {
              id: flickable
              anchors.fill: parent
              // This fixes the issue, but contentHeight should not
              // be needed with a single child, see https://doc.qt.io/qt-6/qml-qtquick-controls-scrollview.html#sizing
              //contentHeight: contentItem.height
              Column {
                  id: contentItem
                  width: parent.width
                  Repeater {
                      model: 20
                      Rectangle {
                          width: flickable.width
                          height: 60
                          color: (index % 2 == 0) ? "red" : "green"
                      }
                  }
              }
          }
      }

      This behavior change breaks at least MultiEffect testbed example (QTBUG-119671).

      Attachments

        Issue Links

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

          Activity

            People

              santhoshkumar Santhosh Kumar Selvaraj
              kagro Kaj Grönholm
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes