このページでは

RadioButton QML Type

オン/オフを切り替え可能な排他ラジオボタン。詳細...

Import Statement: import QtQuick.Controls
Inherits:

AbstractButton

詳細な説明

RadioButtonは、オン(チェック)またはオフ(チェックなし)に切り替え可能なオプションボタンを提供します。ラジオボタンは通常、一連の選択肢の中から1つを選択するために使用されます。

RadioButtonは、AbstractButton からAPIを継承しています。たとえば、AbstractButton APIを使用して、text を設定したり、clicks に反応したりすることができます。ラジオボタンの状態は、checked プロパティで設定できます。

ラジオボタンは、デフォルトで排他モード(auto-exclusive )になっています。同じ親アイテムに属するラジオボタンのうち、一度にチェックできるのは 1 つだけです。別のボタンをチェックすると、以前にチェックされていたボタンは自動的にチェックが解除されます。共通の親を持たないラジオボタンの場合、ButtonGroup を使用して排他性を管理できます。

RadioDelegate は RadioButton と似ていますが、通常はビュー内で使用される点が異なります。

ColumnLayout {
    RadioButton {
        checked: true
        text: qsTr("First")
    }
    RadioButton {
        text: qsTr("Second")
    }
    RadioButton {
        text: qsTr("Third")
    }
}

「 ButtonGroup 」、「RadioButtonのカスタマイズ」、「Buttonコントロール」、および「RadioDelegate 」も参照してください 。

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