このページでは

RadioDelegate QML Type

オン/オフを切り替え可能なラジオインジケーター付きの専用アイテムデリゲート。詳細...

Import Statement: import QtQuick.Controls
Inherits:

ItemDelegate

詳細説明

RadioDelegateは、オン(チェック済み)またはオフ(チェックなし)に切り替え可能なアイテムデリゲートを提供します。ラジオデリゲートは通常、一連の選択肢の中から1つを選択するために使用されます。

RadioDelegateは、ItemDelegate からAPIを継承しており、 はAbstractButton から継承されています。例えば、text を設定し、AbstractButton APIを使用してclicks に反応させることができます。ラジオデリゲートの状態は、checked プロパティで設定できます。

ラジオデリゲートは、デフォルトでauto-exclusive です。同じ親アイテムに属するラジオデリゲートのうち、一度にチェックできるのは1つだけです。別のデリゲートをチェックすると、以前にチェックされていたデリゲートのチェックが自動的に解除されます。共通の親を持たないラジオデリゲートの場合、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.