Qt Quick 예제 - 포지셔너

QML 포지셔너 예제 모음입니다.

포지셔너는 포지셔너와 관련된 작은 QML 예제 모음입니다. 각 예제는 특정 유형이나 기능을 강조하는 작은 QML 파일입니다. 자세한 내용은 Qt Quick - 포지셔닝의 중요 개념을 참조하세요.

예제 실행하기

에서 예제를 실행하려면 Qt Creator에서 Welcome 모드를 열고 Examples 에서 예제를 선택합니다. 자세한 내용은 예제 빌드 및 실행하기를 참조하세요.

전환

트랜지션은 포지셔너에서 항목을 표시하거나 숨길 때 애니메이션 트랜지션을 표시합니다. 다양한 포지셔너에 있는 항목으로 채워진 장면으로 구성됩니다: Column, Row, Grid, Flow 로 구성됩니다. 각 포지셔너에는 트랜지션으로 설명되는 애니메이션이 있습니다.

move: Transition {
    NumberAnimation {
        properties: "x,y"
        easing.type: Easing.OutBounce
    }
}

이동 전환은 포지셔너 내부의 항목이 다른 항목의 등장 또는 사라짐에 따라 위치가 바뀔 때 애니메이션을 적용하는 방법을 지정합니다.

add: Transition {
    NumberAnimation {
        properties: "x,y"
        easing.type: Easing.OutBounce
    }
}

추가 전환은 항목이 포지셔너에 추가될 때 항목이 표시되는 방식을 지정합니다.

populate: Transition {
    NumberAnimation {
        properties: "x,y"
        from: 200
        duration: 100
        easing.type: Easing.OutBounce
    }
}

채우기 전환은 부모 포지셔너가 처음 생성될 때 항목이 표시되는 방식을 지정합니다.

첨부 속성

첨부속성에는 포지셔너 첨부 속성을 사용하여 포지셔너 내에서 항목의 위치를 결정하는 방법이 나와 있습니다.

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)
    }
}

예제 프로젝트 @ code.qt.io

© 2025 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.