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

Problems with property bindings

    XMLWordPrintable

Details

    • 70c37506e9e7c7228ca823cff0f75a5813f3bcb7

    Description

      Run the following example with Qt 5.2 and only part of the red rectangle is visible on startup. If one resizes the window, the red rectangle jumps to the correct location.

      import QtQuick 2.1
      import QtQuick.Window 2.1
      
      Window {
          id: window
      
          width: 320
          height: 240
      
          // doesn't matter if it's an alias or not
          readonly property real contentWidth: window.width
          readonly property alias contentHeight: window.height
      
          Rectangle {
              id: container
              width: window.contentWidth
              height: window.contentHeight
      
              Rectangle {
                  color: "red"
                  x: container.width / 2 - width / 2
                  y: container.height / 2 - height / 2
                  width: window.contentWidth
                  height: window.contentHeight
      
                  Text {
                      anchors.right: parent.right
                      anchors.bottom: parent.bottom
                      text: qsTr("(%1,%2 %3x%4)").arg(parent.x).arg(parent.y).arg(parent.width).arg(parent.height)
                  }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes