|  | Home · All Classes · Main Classes · Annotated · Grouped Classes · Functions |

# QRadioButton Class Reference

The QRadioButton widget provides a radio button with a text label. More...

    #include <QRadioButton>

Part of the QtGui module.

Inherits QAbstractButton.

- List of all members, including inherited members
- Qt 3 support members

### Public Functions

- QRadioButton ( QWidget * parent = 0 )
- QRadioButton ( const QString & text, QWidget * parent = 0 )

- 16 public functions inherited from QAbstractButton
- 182 public functions inherited from QWidget
- 28 public functions inherited from QObject
- 11 public functions inherited from QPaintDevice

### Additional Inherited Members

- 8 properties inherited from QAbstractButton
- 51 properties inherited from QWidget
- 1 property inherited from QObject
- 4 public slots inherited from QAbstractButton
- 17 public slots inherited from QWidget
- 1 public slot inherited from QObject
- 4 signals inherited from QAbstractButton
- 1 signal inherited from QWidget
- 1 signal inherited from QObject
- 4 static public members inherited from QWidget
- 4 static public members inherited from QObject
- 3 protected functions inherited from QAbstractButton
- 37 protected functions inherited from QWidget
- 7 protected functions inherited from QObject

## Detailed Description

The QRadioButton widget provides a radio button with a text label.

A QRadioButton 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.

Radio buttons are autoExclusive by default. If auto-exclusive is enabled, radio buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. If you need multiple exclusive button groups for radio buttons that belong to the same parent widget, put them into a QButtonGroup.

Whenever a button is switched on or off it emits the toggled() signal. Connect to this signal if you want to trigger an action each time the button changes state. Otherwise, use isChecked() to see if a particular button is selected.

Just like QPushButton, a radio button displays text, and optionally a small icon. The text can be set in the constructor or with setText(); the icon is set with setIcon().

Important inherited members: text(), setText(), text(), setDown(), isDown(), autoRepeat(), group(), setAutoRepeat(), toggle(), pressed(), released(), clicked(), and toggled().

GUI Design Handbook: Radio Button

See also QPushButton, QToolButton, and QCheckBox.

## Member Function Documentation

### QRadioButton::QRadioButton ( QWidget * parent = 0 )

Constructs a radio button with the given parent, but with no text or pixmap.

The parent argument is passed on to the QAbstractButton constructor.

### QRadioButton::QRadioButton ( const QString & text, QWidget * parent = 0 )

Constructs a radio button with the given parent and a text string.

The parent argument is passed on to the QAbstractButton constructor.