In the simple example, we simply set the width of the rectangle to that of it's parent. Let's consider a more complicated example:
ApplicationWindow {
visible: true
width: 400
height: 640
Rectangle{
id: rect
anchors.centerIn: parent
height: 100
width: parent.width/2 + parent.width/3
color: "blue"
}
}
In the example, we perform arithmetic operation on the value being binded. If you resize the running application window to maximum width, the gap between the rectangle and the application window will be wider and vice-versa.