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

Dynamically changing the Items in a ColumnLayout while resizing leads to crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.1, 6.6.0
    • 6.4.2
    • Quick: Layouts
    • None
    • macOS 12.6, MacBook Pro (16-inch, 2021)
    • All
    • 24f5695d3 (dev), 8ff4f09b0 (6.5)

    Description

      Using a Repeater in a ColumnLayout that dynamically updates the model while the Layout is resizing will lead to a crash. This is a regression since it works on Qt 6.3.1

      A minimal example is the following:

      import QtQuick
      import QtQuick.Layouts 1.15
      
      Window {
          id: root
          visible: true
          ColumnLayout {
              id: mainColumnLayout
              anchors.fill: parent
              spacing: 1
              Repeater {
                  model: root.fittingCount
                  Rectangle {
                      implicitWidth: root.itemHeight
                      implicitHeight: root.itemHeight
                      color: "orange"
                  }
              }
              Item { Layout.fillHeight: true }
          }
          readonly property int itemHeight: 40
          property int fittingCount: 5
          onHeightChanged: root.updateFittingCount()
      
          function updateFittingCount() {
              fittingCount = Math.random() * 5
          }
      }

      Attachments

        Issue Links

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

          Activity

            People

              smd Jan Arve
              mstarke Michael Starke
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes