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

Loader in a Layout takes up space when inactive

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.0
    • None

    Description

      The inactive Loader below takes up space in the layout. Replacing it with the commented-out Rectangle works as expected.

      import QtQuick 2.8
      import QtQuick.Layouts 1.3
      import QtQuick.Controls 2.1
      
      ApplicationWindow {
          id: window
          objectName: "window"
          width: 800
          height: 800
          visible: true
      
          ColumnLayout {
              id: panelColumnLayout
              spacing: 2
              anchors.right: parent.right
      
              Rectangle {
                  id: colourPanel
                  color: "#444"
                  implicitWidth: 300
                  implicitHeight: 250
      
                  Layout.fillHeight: true
              }
      
              Loader {
                  objectName: "tilesetSwatchLoader"
                  active: false
                  sourceComponent: Rectangle {
                      color: "#444"
                      implicitWidth: 300
                      implicitHeight: 250
                  }
      
                  Layout.fillHeight: true
              }
      //        Rectangle {
      //            color: "#444"
      //            implicitWidth: 300
      //            implicitHeight: 250
      //            visible: false
      
      //            Layout.fillHeight: true
      //        }
      
              Loader {
                  objectName: "layersLoader"
                  active: true
                  sourceComponent: Rectangle {
                      color: "#444"
                      implicitWidth: 300
                      implicitHeight: 250
      
                      Layout.fillHeight: true
                  }
              }
          }
      }
      

      Attachments

        Issue Links

          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
              mitch_curtis Mitch Curtis
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes