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

QQuickWindow does not resize its contentItem before re-opening

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7, 6.8
    • Quick: Other
    • None
    • Windows

    Description

      If QQuickWindow was closed, then later resized and re-opened, the contentItem size is not updated. This happens only in Windows.

      Minimum example:

       

      import QtQuick
      import QtQuick.Controls
      
      Window {
          x: 20
          y: 20
          width: 100
          height: 100
          visible: true
      
          Window {
              id: window
      
              x: 100
              y: 20
              width: 400
              height: 400
              visible: true
              color: "green"
      
              Rectangle {
                  anchors.fill: parent
                  color: "red"
              }
          }
      
          Button {
              text: "Test"
              onClicked: {
                  window.close()
                  timer.start()
              }
          }
      
          Timer {
              id: timer
              interval: 200
              onTriggered: {
                  window.width = 800
                  window.show()
              }
          }
      }

      After clicking the "Test" button in the first window, the second window will be re-opened with the new size, but the red rectangle will occupy only half of its width.

       

      Attachments

        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
            kds Denis Klychkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes