ScrollIndicator QML Type
세로 또는 가로 비대화형 스크롤 표시기. 더 보기...
Import Statement: | import QtQuick.Controls |
Inherits: |
속성
- active : bool
- horizontal : bool
(since QtQuick.Controls 2.3 (Qt 5.10))
- minimumSize : real
(since QtQuick.Controls 2.4 (Qt 5.11))
- orientation : enumeration
- position : real
- size : real
- vertical : bool
(since QtQuick.Controls 2.3 (Qt 5.10))
- visualPosition : real
(since QtQuick.Controls 2.4 (Qt 5.11))
- visualSize : real
(since QtQuick.Controls 2.4 (Qt 5.11))
첨부 속성
- horizontal : ScrollIndicator
- vertical : ScrollIndicator
상세 설명
스크롤 인디케이터는 현재 스크롤 위치를 나타내는 비대화형 인디케이터입니다. 스크롤 표시기는 vertical 또는 horizontal 일 수 있으며, ListView 및 GridView 와 같은 Flickable 에 첨부할 수 있습니다.
Flickable { // ... ScrollIndicator.vertical: ScrollIndicator { } }
스크롤 인디케이터를 플릭커블에 부착하기
참고: ScrollIndicator를 vertically 또는 horizontally 플릭커블에 부착하면 지오메트리와 다음 프로퍼티가 자동으로 설정되고 적절하게 업데이트됩니다:
부착된 스크롤 인디케이터는 대상 플릭커블에 부모를 다시 지정합니다. 세로로 부착된 스크롤 인디케이터는 플릭커블의 높이에 맞게 크기가 조정되고 layout direction 을 기준으로 양쪽에 위치하며, 가로로 부착된 스크롤 인디케이터는 플릭커블의 폭에 맞게 크기가 조정되고 아래쪽에 위치합니다. 연결된 스크롤 인디케이터에 다른 부모를 지정하여 자동 지오메트리 관리를 비활성화할 수 있습니다. 이 기능은 예를 들어 스크롤 인디케이터를 클리핑 플릭커블 외부에 배치해야 하는 경우에 유용할 수 있습니다. 다음 예시를 통해 이를 설명합니다:
Flickable { id: flickable clip: true // ... ScrollIndicator.vertical: ScrollIndicator { parent: flickable.parent anchors.top: flickable.top anchors.left: flickable.right anchors.bottom: flickable.bottom } }
가로 및 세로 스크롤 인디케이터의 활성 상태 바인딩하기
가로 및 세로 스크롤 표시기는 기본적으로 active 상태를 서로 공유하지 않습니다. 어느 한 방향으로 스크롤하는 동안 두 표시기를 모두 표시하려면 다음 예제와 같이 활성 상태 간에 양방향 바인딩을 설정하세요:
Flickable { anchors.fill: parent contentWidth: parent.width * 2 contentHeight: parent.height * 2 ScrollIndicator.horizontal: ScrollIndicator { id: hbar; active: vbar.active } ScrollIndicator.vertical: ScrollIndicator { id: vbar; active: hbar.active } }
연결되지 않은 스크롤 표시기
연결된 프로퍼티 API를 사용하지 않고도 스크롤 인디케이터의 인스턴스를 생성할 수 있습니다. 이는 첨부된 스크롤 표시기의 동작이 충분하지 않거나 Flickable 이 사용되지 않을 때 유용합니다. 다음 예에서는 가로 및 세로 스크롤 표시기를 사용하여 사용자가 텍스트를 얼마나 스크롤했는지 표시합니다( Flickable 대신 MouseArea 사용):
Rectangle { id: frame clip: true width: 160 height: 160 border.color: "black" anchors.centerIn: parent Text { id: content text: "ABC" font.pixelSize: 169 MouseArea { id: mouseArea drag.target: content drag.minimumX: frame.width - width drag.minimumY: frame.height - height drag.maximumX: 0 drag.maximumY: 0 anchors.fill: content } } ScrollIndicator { id: verticalIndicator active: mouseArea.pressed orientation: Qt.Vertical size: frame.height / content.height position: -content.y / content.height anchors { top: parent.top; right: parent.right; bottom: parent.bottom } } ScrollIndicator { id: horizontalIndicator active: mouseArea.pressed orientation: Qt.Horizontal size: frame.width / content.width position: -content.x / content.width anchors { left: parent.left; right: parent.right; bottom: parent.bottom } } }
ScrollBar, 스크롤 표시기 사용자 지정하기 및 표시기 컨트롤을참조하세요 .
속성 문서
active : bool |
이 속성은 표시기가 활성화되었는지, 즉 첨부된 Flickable이 moving 인지 여부를 보유합니다.
어느 방향으로 스크롤하는 동안 both horizontal and vertical indicators visible 을 유지할 수 있습니다.
이 프로퍼티는 스크롤 표시기가 attached to a flickable 일 때 자동으로 설정됩니다.
horizontal : bool |
이 속성은 스크롤 표시기가 수평인지 여부를 보유합니다.
이 프로퍼티는 QtQuick.Controls 2.3(Qt 5.10)에서 도입되었습니다.
orientation 를참조하십시오 .
minimumSize : real |
이 프로퍼티는 0.0 - 1.0
로 스케일된 표시기의 최소 크기를 보유합니다.
이 프로퍼티는 QtQuick.Controls 2.4 (Qt 5.11)에 도입되었습니다.
size, visualSize, visualPosition 를참조하십시오 .
orientation : enumeration |
이 속성은 인디케이터의 방향을 유지합니다.
가능한 값은 다음과 같습니다:
Constant | 설명 |
---|---|
Qt.Horizontal | Horizontal |
Qt.Vertical | 세로(기본값) |
이 속성은 스크롤 표시기가 attached to a flickable 일 때 자동으로 설정됩니다.
horizontal 및 vertical 을참조하십시오 .
position : real |
이 속성은 0.0 - 1.0
로 스케일링된 표시기의 위치를 유지합니다.
이 속성은 스크롤 표시기가 attached to a flickable 일 때 자동으로 설정됩니다.
Flickable::visibleArea 및 visualPosition도 참조하십시오 .
size : real |
이 속성은 0.0 - 1.0
로 스케일링된 표시기의 크기를 유지합니다.
이 속성은 스크롤 표시기가 attached to a flickable 일 때 자동으로 설정됩니다.
Flickable::visibleArea, minimumSize, visualSize도 참조하십시오 .
vertical : bool |
이 속성은 스크롤 표시기가 세로인지 여부를 보유합니다.
이 프로퍼티는 QtQuick.Controls 2.3(Qt 5.10)에 도입되었습니다.
orientation 를참조하십시오 .
visualPosition : real |
이 프로퍼티는 minimum size 에 의해 제한될 수 있는 표시기의 유효 시각적 위치를 보유합니다.
이 프로퍼티는 QtQuick.Controls 2.4 (Qt 5.11)에 도입되었습니다.
position 와 minimumSize 를참조하십시오 .
visualSize : real |
이 프로퍼티는 표시기의 유효 시각적 크기를 보유하며, minimum size 에 의해 제한될 수 있습니다.
이 프로퍼티는 QtQuick.Controls 2.4 (Qt 5.11)에 도입되었습니다.
size 와 minimumSize 를참조하십시오 .
첨부된 속성 문서
ScrollIndicator.horizontal : ScrollIndicator |
이 프로퍼티는 Flickable 에 가로 스크롤 표시기를 첨부합니다.
Flickable { contentWidth: 2000 ScrollIndicator.horizontal: ScrollIndicator { } }
Attaching ScrollIndicator to a Flickable도 참조하십시오 .
ScrollIndicator.vertical : ScrollIndicator |
이 프로퍼티는 Flickable 에 세로 스크롤 표시기를 첨부합니다.
Flickable { contentHeight: 2000 ScrollIndicator.vertical: ScrollIndicator { } }
Attaching ScrollIndicator to a Flickable도 참조하십시오 .
© 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.