💡 가운데 설정
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 800
height: 680
title: qsTr("위치 속성 지정")
Button {
id: btn_center
anchors.centerIn: parent
width: 130
height: 50
text: "가운데 버튼"
}
}
💡 실행 사진
💡 가운데 버튼 왼쪽에 위치 넣기
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 800
height: 680
title: qsTr("위치 속성 지정")
Button {
id: btn_center
anchors.centerIn: parent
width: 130
height: 50
text: "가운데 버튼"
}
Button {
id: btn_left
anchors.right: btn_center.left
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "왼쪽 버튼"
}
}
💡 실행 사진
💡 가운데 버튼 오른쪽에 위치 넣기
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 800
height: 680
title: qsTr("위치 속성 지정")
Button {
id: btn_center
anchors.centerIn: parent
width: 130
height: 50
text: "가운데 버튼"
}
Button {
id: btn_left
anchors.right: btn_center.left
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "왼쪽 버튼"
}
Button {
id: btn_right
anchors.left: btn_center.right
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "오른쪽 버튼"
}
}
💡 실행 사진
💡 가운데 버튼 위에 버튼 넣기
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 800
height: 680
title: qsTr("위치 속성 지정")
Button {
id: btn_center
anchors.centerIn: parent
width: 130
height: 50
text: "가운데 버튼"
}
Button {
id: btn_left
anchors.right: btn_center.left
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "왼쪽 버튼"
}
Button {
id: btn_right
anchors.left: btn_center.right
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "오른쪽 버튼"
}
Button {
id: btn_top
anchors.right: btn_center.right
anchors.bottom: btn_center.top
width: 130
height: 50
text: "가운데 위에 버튼"
}
}
💡 실행 사진
💡 가운데 아래에 버튼 넣기
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
width: 800
height: 680
title: qsTr("위치 속성 지정")
Button {
id: btn_center
anchors.centerIn: parent
width: 130
height: 50
text: "가운데 버튼"
}
Button {
id: btn_left
anchors.right: btn_center.left
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "왼쪽 버튼"
}
Button {
id: btn_right
anchors.left: btn_center.right
anchors.bottom: btn_center.bottom
width: 130
height: 50
text: "오른쪽 버튼"
}
Button {
id: btn_top
anchors.right: btn_center.right
anchors.bottom: btn_center.top
width: 130
height: 50
text: "가운데 위에 버튼"
}
Button {
id: btn_bottom
anchors.left: btn_center.left
anchors.top: btn_center.bottom
width: 130
height: 50
text: "가운데 아래 버튼"
}
}
💡 실행 사진
💡 horizontalCenter , verticalCenter