한국어
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 116741
100 Qt의 오픈소스 라이센스 소개 file makersweb 2019.12.15 17808
99 Qt for MCU 1.0 릴리즈 makersweb 2019.12.10 5817
98 Qt Marketplace 발표 makersweb 2019.12.02 3724
97 QScopedPointer 소개 및 사용법 makersweb 2019.11.29 4160
96 QOpenVirtualkeyboard(Qt 5용 한글 및 영문, 숫자 가상키보드) file makersweb 2019.11.27 5958
95 Qt3D의 QML 타입으로 3D렌더링 file makersweb 2019.11.20 5540
94 라즈베리파이3에서 Boot to Qt 실행해보기 makersweb 2019.11.13 5861
93 Qt애플리케이션 객체(QCoreApplication, QGuiApplication, QApplication) 에 대해서 makersweb 2019.11.11 15391
92 Qt Quick 3D 소개 makersweb 2019.11.09 5108
91 QPushButton 의 커스텀 이미지버튼 file makersweb 2019.11.05 11101
90 qbs 사용 방법(Helloworld) file makersweb 2019.10.23 6456
89 웹기반 Qt Design Viewer [2] file makersweb 2019.10.23 5161
88 Qt Creator에서 Qt의존성 라이브러리 자동복사하기 file makersweb 2019.10.19 6934
87 Qt for Embedded Linux 화면출력 makersweb 2019.10.17 4866
86 Windows에서 Qt 설치 따라하기 file makersweb 2019.10.14 36341
85 Qbs 프로젝트를 정의하기 위해 사용되는 몇가지 중요한 아이템들 file makersweb 2019.10.13 4114
84 많은 리소스를 사용하는 Qt프로젝트에서 고려해봐야 할 qmake 옵션 makersweb 2019.10.11 5952
83 Qbs에 대한 소개와 설치하는 방법 makersweb 2019.10.09 5101
82 OpenGL 렌더링을 QtQuick과 통합하는 방법 file makersweb 2019.10.01 5818
81 QML내에서의 시그널, 슬롯 시스템 makersweb 2019.09.29 10117