RadioButton

A radio button with a text label. More...

Import Statement: import QtQuick.Controls 1.1
Since: Qt 5.1

Properties

Signals

Detailed Description

A RadioButton is an option button that can be switched on (checked) or off (unchecked). Radio buttons typically present the user with a "one of many" choice. In a group of radio buttons, only one radio button at a time can be checked; if the user selects another button, the previously selected button is switched off.

GroupBox {
    title: qsTr("Search")
    Column {
        ExclusiveGroup { id: group }
        RadioButton {
            text: qsTr("From top")
            exclusiveGroup: group
            checked: true
        }
        RadioButton {
            text: qsTr("From cursor")
            exclusiveGroup: group
        }
    }
}

You can create a custom appearance for a RadioButton by assigning a RadioButtonStyle.

Property Documentation

activeFocusOnPress : bool

This property is true if the control takes the focus when it is pressed; forceActiveFocus() will be called on the control.


checked : bool

This property is true if the control is checked.


exclusiveGroup : ExclusiveGroup

This property stores the ExclusiveGroup that the control belongs to.


read-onlyhovered : bool

This property indicates whether the control is being hovered.


pressed : bool

This property is true if the control is being pressed. Set this property to manually invoke a mouse click.


style : Component

The style Component for this control.

See also Qt Quick Controls Styles QML Types.


text : string

This property holds the text that the label should display.


Signal Documentation

clicked()

Emitted whenever the control is clicked.