|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QAbstractButton
com.trolltech.qt.gui.QRadioButton
public class QRadioButton
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 &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()
.
![]() | A radio button shown in the Plastique widget style. |
![]() | A radio button shown in the Windows XP widget style. |
![]() | A radio button shown in the Macintosh widget style. |
QPushButton
, QToolButton
, QCheckBox
, GUI Design Handbook: Radio Button, and Group Box Example.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.gui.QAbstractButton |
---|
clicked, pressed, released, toggled |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QRadioButton()
Constructs a radio button with the given parent, but with no text or pixmap. |
|
QRadioButton(QWidget parent)
Constructs a radio button with the given parent, but with no text or pixmap. |
|
QRadioButton(java.lang.String text)
Constructs a radio button with the given parent and a text string. |
|
QRadioButton(java.lang.String text,
QWidget parent)
Constructs a radio button with the given parent and a text string. |
Method Summary | |
---|---|
static QRadioButton |
fromNativePointer(QNativePointer nativePointer)
|
protected void |
initStyleOption(QStyleOptionButton option)
Initialize option with the values from this QRadioButton. |
Methods inherited from class com.trolltech.qt.gui.QAbstractButton |
---|
animateClick, animateClick, autoExclusive, autoRepeat, autoRepeatDelay, autoRepeatInterval, checkStateSet, click, group, hitButton, icon, iconSize, isCheckable, isChecked, isDown, nextCheckState, setAutoExclusive, setAutoRepeat, setAutoRepeatDelay, setAutoRepeatInterval, setCheckable, setChecked, setDown, setIcon, setIconSize, setShortcut, setShortcut, setShortcut, setText, shortcut, text, toggle |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QRadioButton()
The parent argument is passed on to the QAbstractButton
constructor.
public QRadioButton(QWidget parent)
The parent argument is passed on to the QAbstractButton
constructor.
public QRadioButton(java.lang.String text)
The parent argument is passed on to the QAbstractButton
constructor.
public QRadioButton(java.lang.String text, QWidget parent)
The parent argument is passed on to the QAbstractButton
constructor.
Method Detail |
---|
public static QRadioButton fromNativePointer(QNativePointer nativePointer)
protected final void initStyleOption(QStyleOptionButton option)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |