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

Image in ColumnLayout ignores width and height

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.15.11, 6.2.6, 6.4.1
    • Quick: Layouts
    • Windows 10 Pro 22H2, MSVC 2019 x64
    • Windows

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Layouts 1.15
      
      Window {
          id: mainWindow
          width  : 640
          height : 480
          visible: true
      
          // No Layout: width and height are respected
          Image {
              width : 50
              height: 50
              sourceSize.width : 100
              sourceSize.height: 100
              source: "circle.svg"
          }
      
          // In ColumnLayout: Image is drawn at sourceSize; width and height are ignored
          ColumnLayout {
              x: 50
              width: 50
              height: 50
      
              Image {
                  width : 50
                  height: 50
                  sourceSize.width : 100
                  sourceSize.height: 100
                  source: "circle.svg"
              }
          }
      }
      

       

      Expected outcome
      2 circles are drawn with the same sizes

       

      Actual outcome
      The 2nd circle is bigger than the first

       

      Notes

      This seems to affect Windows but not macOS

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes