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

[Reg 6.7.0 -> dev] Bindings on width/height of ApplicationWindow.background are not respected

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8.0 FF
    • Quick: Controls 2
    • None

    Description

      Reverting https://codereview.qt-project.org/c/qt/qtdeclarative/+/546613 fixes the issue. That patch is meant to make QQuickApplicationWindow check to see if the user has set an explicit width/height, but that check doesn't seem to be working correctly?

      Code

      import QtQuick
      import QtQuick.Controls.Basic
      
      ApplicationWindow {
          id: window
          width: 640
          height: 480
          visible: true
      
          background: Rectangle {
              property real scaleFactor: shrinkBtn.checked ? 0.5 : 1
      
              color: "green"
              width: window.width * scaleFactor
              height: window.height * scaleFactor
              anchors.centerIn: parent
          }
      
          Button {
              id: shrinkBtn
              checkable: true
              text: "Shrink Background"
          }
      }
      

       

      Expected outcome when button is checked (Qt 6.7.0)
      The green background becomes half the size of the window

       

      Actual outcome when button is checked (dev, 2024-04-25)
      The green background remains the same size as the window

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-124744
          # Subject Branch Project Status CR V

          Activity

            People

              mitch_curtis Mitch Curtis
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change