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

QQuickLoader: the loaded item is not resized as appropriate

    XMLWordPrintable

Details

    • qtdeclarative/dev: b7032bed6799c72ef8d89e5763586349b6991b93

    Description

      The Loader documentation states:

      If the size of the Loader is specified explicitly by setting the width, height or by anchoring, the loaded item will be resized to the size of the Loader.

      However, in the following test case, the loaded item does not get a proper size. In fact, it stays at (0,0) unless you uncomment the "anchors.fill: parent" statement, which should not be necessary because the loaded item is supposed to follow the size of the loader.

      import QtQuick 2.0
      
      Loader {
          id: loader
      
          width: implicitWidth
          height: implicitHeight
      
          sourceComponent: Rectangle {
              color: "green"
              implicitWidth: 240
              implicitHeight: 120
              //anchors.fill: parent
          }
      }
      

      To clarify, the window content should be green when it's working correctly.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes