일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- nodejs
- 셀레니움
- Java
- 실시간
- 네이버 블로그 이웃추가 자동
- 네이버 블로그
- 스크래퍼
- 서이추 매크로
- 크롤러
- 서이추 자동
- 웹소켓 서버
- 웹소켓
- Selenium 네이버 블로그
- 서로이웃추가 자동
- 실시간 웹소켓 서버
- kwoss2341
- amqplib
- node.js
- Node
- socket.io
- Selenium
- rabbitmq
- 크롤링
- 국세청
- 서로이웃추가 매크로
Archives
- Today
- Total
defaultK
[Qt 프로그래밍] QML, Rectangle 위치 지정 본문
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.2
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
Rectangle
{
id:r1
width:100
height:100
anchors.centerIn: parent
color:"white"
border.color: "black"
border.width: 5
Text {
id: t1
text: qsTr("r1")
anchors.centerIn: parent
}
}
Rectangle
{
id:r2
width:100
height:100
anchors.left: r1.right
anchors.bottom:r1.bottom
color:"white"
border.color: "black"
border.width: 5
}
Rectangle
{
id:r3
width:100
height:100
anchors.left: r1.left
anchors.top:r1.bottom
color:"white"
border.color: "black"
border.width: 5
Text {
id: t3
text: qsTr("r3")
anchors.centerIn: parent
}
}
Rectangle
{
id:r4
width:100
height:100
anchors.left: r3.right
anchors.bottom:r3.bottom
color:"white"
border.color: "black"
border.width: 5
Text {
id: t4
text: qsTr("r4")
anchors.centerIn: parent
}
}
}
r1 사각형을 중심으로
r2,r3,r4 사각형의 위치를 지정할 수 있다.
anchors.left:
anchors.top
anchors.bottom
속성을 잘 이용하자.
'Qt 프로그래밍 > Basic Qt' 카테고리의 다른 글
[Qt 프로그래밍] QProcess 클래스를 이용한 파일 실행 (1) | 2021.03.20 |
---|---|
[Qt 프로그래밍] qml, cpp 간 signal , slot 연결 (0) | 2021.02.24 |
[Qt 프로그래밍] 크로스컴파일 환경(라즈베리파이)에서 qml 과 cpp object 연동하기 (0) | 2021.02.24 |
[Qt 프로그래밍] Signal 과 Slot 이해하기 (0) | 2021.02.24 |
[Qt 프로그래밍] QML 상대 위치지정 속성 Positioning with Anchors (0) | 2021.02.22 |
Comments