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

Delayed width calculation with Layout.fillwidth true on StackLayout indices except zero

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.1, 6.7.2
    • Quick: Layouts
    • None
    • Windows

    Description

      Using Layout.fillWidth true on the contents of a StackLayout which has index greater than zero (that is, not the default index) and the contents are nested in another layout (e.g. ColumnLayout) results in bad computation of the initial width when the StackLayout index is switched to e.g. with a TabBar.  The attached Qt for Python example can be used to reproduce this behavior:

      1. In a fresh Python virtual environment, install PySide6 6.7.1 or 6.7.2 using pip
      2. Run qml_test.py to display the test application.
      3. Note that on the initial load, the first TabBar/StackLayout index is selected and the red rectangle fills the window as expected
      4. Click Tab 2 to activate it and note that the window does not show a green rectangle filling the area as expected
      5. Resize the window e.g. by dragging the right edge of the window and note that once the window repaints the green rectangle now fills the window area as expected.
      6. Tab 3 shows a similar behavior with a GroupBox with Layout.fillWidth true, as another example.
      7. (Optional) replace PySide6 with version 6.7.0 and note that this version produces the expected behavior (switching to Tab 2 immediately shows the green rectangle or Tab 3 the group box at full width as expected).

      The QML for the example is embedded in the Python script.  I have attached a separate identical version as view.qml.

      Attachments

        1. qml_test.py
          2 kB
        2. view.qml
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            isaacansys Isaac Waldron
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes