Qt:Документация 4.3.2/qradiobutton

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QRadioButton Class Reference
[модуль QtGui ]

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

 #include <QRadioButton>

Inherits QAbstractButton.

[править] Открытые функции

  • 21 открытых функций унаследованных от QAbstractButton
  • 201 открытых функций унаследованных от QWidget
  • 29 открытых функций унаследованных от QObject
  • 12 открытых функций унаследованных от QPaintDevice

[править] Защищенные функции

  • 3 защищенных функций унаследованных от QAbstractButton
  • 38 защищенных функций унаследованных от QWidget
  • 7 защищенных функций унаследованных от QObject
  • 1 защищенная функция унаследованна от QPaintDevice

[править] Дополнительные унаследованные члены

  • 11 свойства унаследованных от QAbstractButton
  • 56 свойства унаследованных от QWidget
  • 1 свойство унаследованное от QObject
  • 5 открытых слотов унаследованных от QAbstractButton
  • 19 открытых слотов унаследованных от QWidget
  • 1 открытый слот унаследованный от QObject
  • 4 сигнала унаследованных от QAbstractButton
  • 1 сигнал унаследованный от QWidget
  • 1 сигнал унаследованный от QObject
  • 4 статических открытых члена унаследованных от QWidget
  • 5 статических открытых члена унаследованных от QObject
  • 1 защищенный слот унаследованный от QWidget

[править] Подробное описание

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. Use isChecked() to see if a particular button is selected.

Just like QPushButton, a radio button displays text, and optionally a small icon. The icon is set with setIcon(). The text can be set in the constructor or with setText(). A shortcut key can be specified by preceding the preferred character with an ampersand in the text. For example:

 QRadioButton *button = new QRadioButton("Search from the &amp;cursor", this);

In this example the shortcut is Alt+c. See the QShortcut documentation for details (to display an actual ampersand, use '&&').

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


Файл:Plastique-radiobutton.png A radio button shown in the Plastique widget style.
center A radio button shown in the Windows XP widget style.
center A radio button shown in the Macintosh widget style.

See also QPushButton, QToolButton, QCheckBox, GUI Design Handbook: Radio Button, and Group Box Example.


[править] Описание функций-членов

[править]
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.

[править]
void QRadioButton::initStyleOption ( QStyleOptionButton * option ) const [protected]

Initialize option with the values from this QRadioButton. This method is useful for subclasses when they need a QStyleOptionButton, but don't want to fill in all the information themselves.

See also QStyleOption::initFrom().


Copyright © 2007 Trolltech Trademarks
Qt 4.3.2