Qt Quick 예제 - 포지셔너
이곳은 QML 포지셔너 예제 모음입니다.

'포지셔너'는 포지셔너와 관련된 간단한 QML 예제 모음입니다. 각 예제는 특정 유형이나 기능을 강조하는 작은 QML 파일로 구성되어 있습니다. 자세한 내용은 ' Qt Quick 의 중요한 개념 - 위치 지정'을 참조하십시오.
예제 실행
다음에서 예제를 실행할 수 있습니다:
- Qt Creator
Welcome 모드를 열고 Examples 에서 예제를 선택하십시오. 자세한 내용은 Qt Creator: 튜토리얼: 빌드 및 실행을 참조하십시오.
- Qt Extension for Visual Studio Code
Command Palette 에서 Qt: Open Qt examples 명령을 실행하고 목록에서 예제를 선택하십시오. 자세한 내용은 Qt Extension for Visual Studio Code: 튜토리얼: 빌드 및 실행을 참조하십시오.
전환
'Transitions'는 포지셔너 내의 항목을 표시하거나 숨길 때 애니메이션 전환 효과를 보여줍니다. 이 튜토리얼은 Column, Row, Grid, Flow 등 다양한 포지셔너에 항목이 배치된 장면으로 구성되어 있습니다. 각 포지셔너에는 'Transitions'로 설명된 애니메이션이 있습니다.
move: Transition {
NumberAnimation {
properties: "x,y"
easing.type: Easing.OutBounce
}
}‘이동(move)’ 전환은 다른 아이템의 출현 또는 소멸로 인해 위치 지정기 내의 아이템이 이동할 때 어떤 애니메이션이 적용될지를 지정합니다.
add: Transition {
NumberAnimation {
properties: "x,y"
easing.type: Easing.OutBounce
}
}'add' 전환은 항목이 포지셔너에 추가될 때 어떻게 나타나는지를 지정합니다.
populate: Transition {
NumberAnimation {
properties: "x,y"
from: 200
duration: 100
easing.type: Easing.OutBounce
}
}'populate' 전환은 상위 포지셔너가 처음 생성될 때 항목이 어떻게 나타나는지를 지정합니다.
부착 속성
'부착된 속성'에서는 포지셔너의 부착된 속성을 사용하여 포지셔너 내에서 항목의 위치를 파악하는 방법을 보여줍니다.
Rectangle {
id: green
color: "#80c342"
width: 100 * page.ratio
height: 100 * page.ratio
Text {
anchors.left: parent.right
anchors.leftMargin: 20
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Index: %1%2%3").arg(parent.Positioner.index)
.arg(parent.Positioner.isFirstItem ? qsTr(" (First)") : "")
.arg(parent.Positioner.isLastItem ? qsTr(" (Last)") : "")
}
// When mouse is clicked, display the values of the positioner
MouseArea {
anchors.fill: parent
onClicked: column.showInfo(green.Positioner)
}
}© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.