Positioner QML Type
포지셔너 내에서 항목이 위치한 위치에 대한 세부 정보를 포함하는 첨부 속성을 제공합니다. 더 보기...
| Import Statement: | import QtQuick |
부착 속성
- index : int
- isFirstItem : bool
- isLastItem : bool
상세 설명
Positioner 유형의 객체는 Column, Row, Flow 또는 Grid 내의 최상위 자식 항목에 연결됩니다. 이 객체는 자식 항목이 상위 Column, Row, Flow 또는 Grid의 레이아웃 내에서 자신이 위치한 위치를 파악할 수 있도록 하는 속성을 제공합니다.
예를 들어, 아래는 ` Repeater`을 통해 생성된 16개의 자식 사각형을 가진 ` Grid `입니다. 각 ` Rectangle `은 ` Positioner.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.index : int [read-only attached]
이 속성을 통해 항목은 포지셔너 내에서 자신의 인덱스를 결정할 수 있습니다.
Positioner.isFirstItem : bool [read-only attached]
Positioner.isLastItem : bool [read-only attached]
이 속성들을 통해 해당 항목은 포지셔너 내에서 첫 번째 항목인지, 마지막 항목인지 각각 판단할 수 있습니다.
© 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.