anchors.right: parent.right
anchors.centerIn: parent
anchors.要设置,不然不能自适应屏幕
ColumnLayout{
// anchors.bottomMargin: 10
// anchors.centerIn: parent //相对parten居中
anchors.right: parent.right
spacing: 10
RowLayout{
x:40
y:50
spacing: 20
Rectangle
{
Layout.preferredHeight: 20
Layout.preferredWidth: 20
Layout.alignment: Qt.AlignLeft
color:"red"
}
Rectangle
{
Layout.preferredHeight: 20
Layout.preferredWidth: 20
Layout.alignment: Qt.AlignLeft
color:"red"
}
Rectangle
{
Layout.preferredHeight: 20
Layout.preferredWidth: 20
Layout.alignment: Qt.AlignLeft
color:"red"
}
}