한국어
Qt
 

이번엔 아이템들을 배치 시키는 컴포넌트를 소개한다.

 

Row

Row는 가로형태로 아이템을 배치시킨다.

import QtQuick 2.11
import QtQuick.Window 2.11

Window {
    id: idWindow
    visible: true
    width: 700
    height: 300
    flags: Qt.FramelessWindowHint

    Row{
        anchors.centerIn: parent
        spacing: 20

        Image{
            source: "houses-1622066_640.jpg"
        }

        Image{
            source: "houses-1622066_640.jpg"
        }
    }
}

 

Row를 이용해 Image를 가로형태로 배치시켰다.

row.png

 

Repeater를 사용하면 같은 아이템들을 일일이 나열할 필요없이 간단하게 아이템을 반복하여 배치시킬 수 있다.

Rectangle{
    anchors.fill: parent
    color: "#F0F0F0"

    Row{
        anchors.centerIn: parent
        spacing: 20

        Repeater{
            model: 2
            Image{
                source: "houses-1622066_640.jpg"
            }
        }
    }
}

 

Column

Column은 아이템들을 새로로 배치 시킨다.

import QtQuick 2.11
import QtQuick.Window 2.11

Window {
    id: idWindow
    visible: true
    width: 400
    height: 600
    flags: Qt.FramelessWindowHint


    Rectangle{
        anchors.fill: parent
        color: "#F0F0F0"

        Column{
            anchors.centerIn: parent
            spacing: 20

            Image{
                source: "houses-1622066_640.jpg"
            }

            Image{
                source: "kingfisher-2046453__180.jpg"
            }
            Rectangle{
                color: "green"
                width: 110
                height: 50
            }
        }
    }
}

 

Image와 Rectangle을 새로로 배치

Column.png

 

번호 제목 글쓴이 날짜 조회 수
공지 Qt프로그래밍(QtQuick) Beginner를 위한 글 읽는 순서 운영자 2019.01.05 85343
56 tslib의 ts_calibrate를 응용해서 Qt로 터치보정기능 구현 file makersweb 2019.04.06 1350
55 GPU가 없는 장치에서 Qt Quick을 사용 makersweb 2019.04.02 1850
54 QTextCodec클래스를 사용하여 유니코드와 EUC-KR 변환 makersweb 2019.03.25 2860
53 qInstallMessageHandler를 이용한 디버그 메세지 출력 제어하기 makersweb 2019.02.25 1339
52 Qt5기반 독립 프로세스(out-of-process)로 동작하는 가상키보드(virtual keyboard) file makersweb 2019.02.24 2605
51 Qml 기본 컴포넌트 강좌 (4) - 모델 리스팅(Listing) file 운영자 2019.02.23 5257
50 Qt Bluetooth를 이용한 시리얼(Serial) 통신 file makersweb 2019.02.17 3496
» Qml 기본 컴포넌트 강좌 (3) - 배치(positioning) 컴포넌트 file 운영자 2019.02.10 4823
48 QString 문자열 다루기 예제 운영자 2019.01.26 39601
47 Qt SQL을 이용한 가벼운 데이터베이스 다루기 [1] file 운영자 2019.01.23 6879
46 구글 클라우드 Speech-To-Text API를 Qt기반(C++, Qml)테스트 [7] file makersweb 2019.01.20 2608
45 QNetworkAccessManager를 통해 HTTP POST 하는 예제 makersweb 2019.01.17 4715
44 Qt응용프로그램 실행 시 콘솔창(터미널)같이 띄우기 file makersweb 2019.01.16 4440
43 안드로이드 가상장치 사용 file makersweb 2019.01.13 1059
42 Qml 기본 컴포넌트 강좌 (2) [2] file makersweb 2019.01.05 8583
41 Qml 기본 컴포넌트 강좌 (1) file makersweb 2019.01.03 11976
40 QtWayland와 ivi-compositor file makersweb 2018.12.27 2395
39 Qml과 C++로 구현하는 GUI어플리케이션 file makersweb 2018.12.25 13828
38 싱글터치 스크린 및 임베디드 리눅스 기반에서 Qt 터치입력 makersweb 2018.12.24 1385
37 ShaderEffect QML Type 을 이용한 그래픽효과 file makersweb 2018.12.09 2091