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

QQC2 SplitView does not honor size constraints when parent is resizing

    XMLWordPrintable

Details

    Description

      It looks like QQuickSplitView does not respect size constraints (min/max/fill width/height) when the parent item is resized.

      Here is an example:

       

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      import QtQuick.Controls.Material
      
      ApplicationWindow {
          width: 640
          height: 480
          minimumWidth: 400
          minimumHeight: 400
          visible: true
          title: qsTr("Hello World")
      
          SplitView {
              id: splitView
      
              anchors.fill: parent
              hoverEnabled: true
      
              Pane {
                  Material.background: Material.Blue
                  SplitView.minimumWidth: 50
              }
      
              Pane {
                  Material.background: Material.Green
                  SplitView.fillWidth: true
                  SplitView.minimumWidth: 300
              }
      
              Pane {
                  Material.background: Material.Blue
                  SplitView.minimumWidth: 50
              }
          }
      }
      

       

      1. Resize first item so that it uses the maximum space available (see screenshot Step 1 -> Step 2). The minimum width of all items is respected at this point.
      2. Decrease the size of the window (see screenshot Step3 & Step4) -> note how the first item still occupies the same space and how the rest of the items are cut. Since both the right and the central item have a minimumWidth set and there is still enough space available for all items to be visible, I would have expected the blue item to be "pushed" to ensure all items are still visible and respect their minimum width.
      3. Weirdly, if you click on the first split handle and move it very slightly then the item layout is magically restored and all items can be seen (see screenshot Step 5 & Step 6) 

      Attachments

        1. Step1.png
          Step1.png
          19 kB
        2. Step2.png
          Step2.png
          19 kB
        3. Step3.png
          Step3.png
          19 kB
        4. Step4.png
          Step4.png
          19 kB
        5. Step5.png
          Step5.png
          19 kB
        6. Step6.png
          Step6.png
          18 kB

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            colinduquesnoy Colin Duquesnoy
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: