Positioner QML Type

포지셔너에서 항목이 존재하는 위치에 대한 세부 정보가 포함된 첨부 프로퍼티를 제공합니다. 더 보기...

Import Statement: import QtQuick

첨부된 속성

자세한 설명

위치 지정자 유형의 객체는 열, 행, 흐름 또는 그리드 내의 최상위 자식 항목에 첨부됩니다. 자식 항목이 부모 열, 행, 흐름 또는 그리드의 레이아웃 내에서 존재하는 위치를 결정할 수 있는 속성을 제공합니다.

예를 들어 아래는 Repeater 을 통해 생성된 16개의 자식 사각형이 있는 Grid 입니다. 각 RectanglePositioner.index 을 사용하여 그리드에 색인을 표시하고 첫 번째 항목은 Positioner.isFirstItem 을 고려하여 색상을 다르게 지정합니다:

Grid {
    Repeater {
        model: 16

        Rectangle {
            id: rect
            width: 30; height: 30
            border.width: 1
            color: Positioner.isFirstItem ? "yellow" : "lightsteelblue"

            Text { text: rect.Positioner.index }
        }
    }
}

첨부된 속성 문서

Positioner.isFirstItem : bool [read-only]

Positioner.isLastItem : bool [read-only]

이 속성을 사용하면 항목이 포지셔너의 첫 번째 항목인지 마지막 항목인지 각각 결정할 수 있습니다.


Positioner.index : int [read-only]

이 속성을 사용하면 항목이 포지셔너 내에서 해당 인덱스를 결정할 수 있습니다.


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