IndicatorStyle QML Type
컨트롤의 표시기 스타일을 정의합니다. 자세히 보기...
| Import Statement: | import Qt.labs.StyleKit |
| Inherits: | |
| Status: | Technology preview |
이 유형은 기술 미리 보기 단계에 있으며 변경될 수 있습니다.
속성
- first : SubIndicatorStyle
- foreground : DelegateStyle
- second : SubIndicatorStyle
상세 설명
IndicatorStyle은 지표 스타일링에 특화된 속성을 추가하여 DelegateStyle 을 확장합니다.
IndicatorStyle 자체는 인디케이터의 배경을 정의하는 반면, foreground 은 그 내부에 그려지는 내용을 정의합니다. 예를 들어, checkBox.indicator 는 체크박스 테두리의 스타일을 지정하고, checkBox.indicator.foreground 는 체크 표시의 스타일을 지정합니다. switchControl, slider 및 progressBar 의 경우, 인디케이터는 홈(groove)의 스타일을 지정하고, 포그라운드(foreground)는 채우기(fill)의 스타일을 지정합니다.
checkBox {
background.visible: false
text.alignment: Qt.AlignVCenter | Qt.AlignLeft
indicator {
color: "transparent"
border.width: 1
foreground {
color: "transparent"
image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png"
// Hide the checkMark when the CheckBox is unchecked
visible: false
}
}
checked {
// Show the checkMark when the CheckBox is checked
indicator.foreground.visible: true
}
}일부 컨트롤에는 하나 이상의 인디케이터가 있습니다. 예를 들어, SpinBox 에는 증가 버튼과 감소 버튼이 모두 있습니다. 이러한 버튼은 first 및 second 하위 인디케이터인 spinBox.indicator.first 와 spinBox.indicator.second 를 사용하여 독립적으로 스타일을 지정할 수 있습니다. SpinBox 의 경우, indicator.first 는 증가 버튼의 스타일을 지정하고, indicator.second 는 감소 버튼의 스타일을 지정합니다. 하위 인디케이터에 설정되지 않은 속성은 인디케이터 자체의 기본값으로 적용됩니다.
참고: up 및 down 속성은 하위 호환성을 위해 first 및 second 의 별칭으로 유지됩니다. 새로운 코드에서는 first 및 second 을 사용해야 합니다. 이 이름들은 범용적이며, 상/하 동작을 나타내지 않는 서브 인디케이터를 가진 컨트롤에서도 사용할 수 있기 때문입니다. 호환성 별칭은 향후 버전에서 제거될 수 있습니다.
spinBox {
text.alignment: Qt.AlignHCenter | Qt.AlignVCenter
padding: 0
indicator {
fillHeight: true
color: "navy"
opacity: 0.1
foreground {
color: "transparent"
margins: 10
image.color: "navy"
image.fillMode: Image.PreserveAspectFit
image.source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/arrow-indicator.png"
width: 10
height: 10
alignment: Qt.AlignCenter
}
// up button
first {
alignment: Qt.AlignRight
foreground.rotation: -90
}
// down button
second {
alignment: Qt.AlignLeft
foreground.rotation: 90
}
}
}참고: Qt.labs 모듈의 타입은 향후 버전에서 호환성이 유지될 것이라고 보장되지 않습니다.
SubIndicatorStyle, DelegateStyle, ControlStyle, ControlStateStyle 및 FallbackStyle 참조문서를 참조하십시오 .
속성 문서
first : SubIndicatorStyle
여러 개의 표시기를 노출하는 컨트롤의 첫 번째 하위 표시기에 스타일을 적용하기 위한 그룹화된 속성입니다. SpinBox 의 경우, 이 속성은 증분 버튼에 스타일을 적용합니다. 속성이 설정되지 않은 경우 표시기 자체의 스타일이 적용됩니다.
참고: up 속성은 하위 호환성을 위해 first 의 별칭으로 유지됩니다. 새로운 코드에서는 first 을 사용해야 합니다. 이 이름은 범용적이며, '위로' 동작을 나타내지 않는 하위 표시기가 있는 컨트롤에서도 사용할 수 있기 때문입니다. 이 호환성 별칭은 향후 버전에서 제거될 수 있습니다.
second도 참조하십시오 .
foreground : DelegateStyle
이 표시기의 전경 요소에 스타일을 적용하기 위한 그룹화된 속성입니다. 예를 들어, checkBox.indicator 는 체크박스 테두리를 설명하는 반면, checkBox.indicator.foreground 는 체크 표시를 나타냅니다.
slider, progressBar, switchControl 와 같은 컨트롤의 경우, indicator.foreground 는 진행 상태 표시선 또는 홈 내부의 채워진 부분을 나타내고, indicator 자체는 홈을 나타냅니다.
second : SubIndicatorStyle
예를 들어 ` SpinBox`의 두 번째 하위 표시기를 스타일링하기 위한 그룹화된 속성입니다. 설정되지 않은 속성은 해당 표시기 자체의 값으로 대체됩니다.
참고: down 속성은 하위 호환성을 위해 second 의 별칭으로 유지됩니다. 새로운 코드에서는 second 을 사용해야 합니다. 이 이름은 범용적이며, '아래로' 동작을 나타내지 않는 하위 표시기가 있는 컨트롤에서도 사용할 수 있기 때문입니다. 이 호환성 별칭은 향후 버전에서 제거될 수 있습니다.
first도 참조하십시오 .
© 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.