이 페이지에서

RadioDelegate QML Type

켜고 끌 수 있는 라디오 표시기가 있는 전용 항목 델리게이트. 더 보기...

Import Statement: import QtQuick.Controls
Inherits:

ItemDelegate

상세 설명

RadioDelegate는 켜기(선택) 또는 끄기(선택 해제)로 전환할 수 있는 항목 델리게이트를 제공합니다. 라디오 델리게이트는 일반적으로 여러 옵션 중에서 하나의 옵션을 선택하는 데 사용됩니다.

RadioDelegate는 ItemDelegate 에서 API를 상속받으며, 이는 AbstractButton 에서 상속받은 것입니다. 예를 들어, text 를 설정하고, AbstractButton API를 사용하여 clicks 에 반응할 수 있습니다. 라디오 델리게이트의 상태는 checked 속성을 통해 설정할 수 있습니다.

라디오 델리게이트는 기본적으로 auto-exclusive 입니다. 동일한 부모 항목에 속한 라디오 델리게이트 중 한 번에 하나의 델리게이트만 선택될 수 있으며, 다른 델리게이트를 선택하면 이전에 선택되었던 델리게이트의 선택이 자동으로 해제됩니다. 공통 부모 항목이 없는 라디오 델리게이트의 경우, ButtonGroup 를 사용하여 배타성을 관리할 수 있습니다.

RadioButton 는 RadioDelegate와 유사하지만, 일반적으로 뷰에서는 사용되지 않고, 옵션이 소수일 때 주로 사용되며, 각 버튼을 고유하게 식별해야 하는 경우가 많습니다.

ButtonGroup {
    id: buttonGroup
}

ListView {
    model: ["Option 1", "Option 2", "Option 3"]
    delegate: RadioDelegate {
        text: modelData
        checked: index == 0
        ButtonGroup.group: buttonGroup
    }
}

‘RadioDelegate 사용자 정의’, ‘Delegate 컨트롤’ 및 ‘ RadioButton ’항목도 참조하십시오 .

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