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

QML Image does not rescale on setGeometry() when "layer" is enabled

    XMLWordPrintable

Details

    • Linux/X11, macOS
    • b0fc5287b8 (qt/qtdeclarative/dev) e105b81805 (qt/qtdeclarative/6.3) b0fc5287b8 (qt/tqtc-qtdeclarative/dev) e105b81805 (qt/tqtc-qtdeclarative/6.3) 7cb26d3678 (qt/qtdeclarative/6.4) 7cb26d3678 (qt/tqtc-qtdeclarative/6.4)

    Description

      When the property "layer" is enabled, the resizing/rendering of the image after changing the geometry of the main window does not work properly. This is for all of the following situations:

      • changing the main window from "Maximized" to "Windowed" mode
      • calling "setGeometry(...)" in QML
      • calling "setGeometry(...)" from CPP
      • calling "resize(...)" from CPP

      Resizing/Rendering works correct for the following situations:

      • calling "setWidth()" and "setHeight()" in QML
      • calling "setWidth()" and "setHeight()" in CPP
      • resizing the main window by "dragging the border"

      See the following minimal reproducable example:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      
      Window {
      	id: root
      
      	width: 300
      	height: 300
      
      	visible: true
      
      	Image {
      		id: image
      
      		anchors.fill: parent
      		fillMode: Image.PreserveAspectFit
      		source: "qrc:/status_ok.svg"
      
      		layer.enabled: true
      
      		MouseArea {
      			anchors.fill: parent
      			onClicked: {
      				root.setGeometry(root.x, root.y, 200, 200)
      			}
      		}
      	}
      }

       

       

       

       

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              jgreilich Julian Greilich
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes