If our screen consists of three elements. And when changing the size of the window, we want to stretch only the central. It is necessary to fix the side elements to the edges of the visible area
import QtQuick 2.0
Rectangle {
width: 500; height: 200
color: "lightgray"
Rectangle {
id: rect1
width: 100
height: parent.height
color: "blue"
anchors.left: parent.left
anchors.top: parent.top
anchors.bottom: parent.bottom
}
Rectangle {
id: rect2
height: parent.height
anchors.top: rect1.top
anchors.left: rect1.right
anchors.right: rect3.left
color: "green"
}
Rectangle {
id: rect3
width: 100
height: parent.height
anchors.top: parent.top
anchors.right: parent.right
color: "blue"
}
}
Комментариев нет:
Отправить комментарий