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

Quick Layouts behaviour regression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.4.1
    • Quick: Layouts
    • None
    • All

    Description

      Starting with 6.4.1 (possibly 6.4.0 too, haven't checked) I'm seeing some odd behaviour regarding nested ColumnLayouts in combination with Layout.preferredWidth.

          ColumnLayout
          {
              anchors.fill: parent
      
              ColumnLayout
              {
                  Rectangle
                  {
                      id: mainRect
                      Layout.preferredWidth: 160
                      Layout.fillHeight: true
                      color: "blue"
                  }
      
                  Rectangle
                  {
                      onWidthChanged: console.log("green rect", width);
                      implicitWidth: mainRect.width
                      implicitHeight: 10
                      color: "green"
                  }
      
                  Rectangle
                  {
                      onWidthChanged: console.log("red rect", width);
                      implicitWidth: mainRect.width
                      implicitHeight: 10
                      color: "red"
                  }
              }
          }
      

      On 6.3.2 I see this:

      qml: green rect 160
      qml: red rect 160
      

      On 6.4.1, this is the situation:

      qml: green rect 160
      qml: red rect 160
      qml: red rect 0
      

      It doesn't make sense that the red rectangle is a different width to the green one, given their implicitWidth bindings being identical. Nor is it clear why its width gets set correctly initially, and is then zeroed.

      Interestingly, if I replace

      Layout.preferredWidth: 160

      ...with...

      implicitWidth: 160

      I get the 6.3.x behaviour.

      Attachments

        Issue Links

          Activity

            People

              mikolaj.boc MikoĊ‚aj Boc
              timangus Tim Angus
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: