Switch QML Type

켜거나 끌 수 있는 스위치 버튼입니다. 더 보기...

Import Statement: import QtQuick.Controls
Inherits:

AbstractButton

속성

상세 설명

스위치는 끌어서 켜거나(체크) 끄거나(체크 해제) 전환할 수 있는 옵션 버튼입니다. 스위치는 일반적으로 두 가지 상태 중에서 선택하는 데 사용됩니다. 목록과 같이 더 큰 옵션 집합의 경우 SwitchDelegate 을 대신 사용하는 것이 좋습니다.

Switch는 AbstractButton 에서 API를 상속받습니다. 예를 들어 checked 속성을 사용하여 스위치의 상태를 설정할 수 있습니다. 사용자가 터치, 마우스 또는 키보드를 통해 스위치를 대화형으로 클릭하면 클릭 및 토글 신호가 발생합니다.

ColumnLayout {
    Switch {
        text: qsTr("Wi-Fi")
        checked: Networking.wifiEnabled
        onClicked: Networking.wifiEnabled = checked
    }
    Switch {
        text: qsTr("Bluetooth")
        checked: Networking.bluetoothEnabled
        onClicked: Networking.bluetoothEnabled = checked
    }
}

스위치버튼 컨트롤사용자 지정하기를참조하세요 .

프로퍼티 문서

position : real [read-only]

이 프로퍼티는 엄지 표시기의 논리적 위치를 저장합니다.

위치는 0.0 - 1.0 범위에서 표시기 크기의 일부분으로 표현됩니다. 이 위치는 예를 들어 엄지 손가락이 중간 지점을 지나 드래그되었는지 여부를 확인하는 데 사용할 수 있습니다. 엄지 손가락 표시기를 시각화하려면 오른쪽에서 왼쪽으로 인식되는 visualPosition 을 대신 사용해야 합니다.

visualPosition도 참조하세요 .


visualPosition : real [read-only]

이 속성은 엄지 표시기의 시각적 위치를 유지합니다.

위치는 0.0 - 1.0 범위에서 표시기 크기의 일부분으로 표시됩니다. 컨트롤이 mirrored 인 경우 값은 1.0 - position 과 같습니다. 이 값은 오른쪽에서 왼쪽 지원을 고려한 엄지 표시기를 시각화하는 데 적합합니다. 예를 들어 엄지 손가락이 중간 지점을 지나 드래그되었는지 여부를 확인하려면 논리적 position 을 대신 사용해야 합니다.

position참조하세요 .


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