Anclaje de controles
La propiedad de anclaje de un control permite situarlo en relación al control padre que lo contiene o en relación a otros controles.
Last updated
La propiedad de anclaje de un control permite situarlo en relación al control padre que lo contiene o en relación a otros controles.
Last updated
import QtQuick 2.15
import QtQuick.Controls 2.15
import org.mauikit.controls 1.3 as Maui
Maui.ApplicationWindow
{
id: root
Maui.Page {
anchors.fill: parent
showCSDControls: true
Rectangle {
id: rect1
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 100
width: 100
height: 100
color: "deeppink"
radius: 4
Label {
anchors.centerIn: parent
text: "rect1"
}
}
Rectangle {
id: rect2
anchors.centerIn: parent
width: 100
height: 100
color: "mediumspringgreen"
radius: 4
Label {
anchors.centerIn: parent
text: "rect2"
}
}
}
}anchors.centerIn: parentanchors.fill: parentanchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenteranchors.top: rect1.bottom
anchors.right: rect1.leftimport QtQuick 2.15
import QtQuick.Controls 2.15
import org.mauikit.controls 1.3 as Maui
Maui.ApplicationWindow
{
id: root
Maui.Page {
anchors.fill: parent
showCSDControls: true
Rectangle {
id: rect1
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: 100
width: 100
height: 100
color: "deeppink"
radius: 4
z: 1
Label {
anchors.centerIn: parent
text: "rect1"
}
}
Rectangle {
id: rect2
anchors.fill: parent
width: 100
height: 100
color: "mediumspringgreen"
radius: 4
Label {
anchors.centerIn: parent
text: "rect2"
}
}
}
}