이 페이지에서

Switch QML Type

켜고 끌 수 있는 토글 버튼. 더 보기...

Import Statement: import QtQuick.Controls
Inherits:

AbstractButton

속성

상세 설명

스위치(Switch)는 드래그하거나 토글하여 켜기(선택) 또는 끄기(선택 해제)가 가능한 옵션 버튼입니다. 스위치는 일반적으로 두 가지 상태 중에서 하나를 선택하는 데 사용됩니다. 목록과 같이 더 많은 옵션이 있는 경우에는 대신 SwitchDelegate 를 사용하는 것을 고려해 보십시오.

스위치(Switch)는 라디오 버튼( AbstractButton)에서 API를 상속받습니다. 예를 들어, checked 속성을 사용하여 스위치의 상태를 설정할 수 있습니다. clicked 및 AbstractButton::toggled 신호는 사용자가 터치, 마우스 또는 키보드를 통해 스위치를 클릭할 때 발생합니다.

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도 참조하십시오 .

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