|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QButtonGroup
public class QButtonGroup
The QButtonGroup class provides a container to organize groups of button widgets. QButtonGroup provides an abstract container into which button widgets can be placed. It does not provide a visual representation of this container (see QGroupBox
for a container widget), but instead manages the states of each of the buttons in the group.
An exclusive
button group switches off all checkable (toggle) buttons except the one that was clicked. By default, a button group is exclusive. The buttons in a button group are usually checkable QPushButton
's, QCheckBox
es (normally for non-exclusive button groups), or QRadioButton
s. If you create an exclusive button group, you should ensure that one of the buttons in the group is initially checked; otherwise, the group will initially be in a state where no buttons are checked.
A button is added to the group with addButton()
. It can be removed from the group with removeButton()
. If the group is exclusive, the currently checked button is available as checkedButton()
. If a button is clicked the buttonClicked()
signal is emitted. For a checkable button in an exclusive group this means that the button was checked. The list of buttons in the group is returned by buttons()
.
In addition, QButtonGroup can map between integers and buttons. You can assign an integer id to a button with setId()
, and retrieve it with id()
. The id of the currently checked button is available with checkedId()
, and there is an overloaded signal buttonClicked()
which emits the id of the button. The purpose of the mapping mechanism is to simplify the representation of enum values in a user interface.
QGroupBox
, QPushButton
, QCheckBox
, and QRadioButton
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
buttonClicked
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
buttonIdClicked
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
buttonIdPressed
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
buttonIdReleased
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
buttonPressed
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
buttonReleased
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QButtonGroup()
Constructs a new, empty button group with the given parent. |
|
QButtonGroup(QObject parent)
Constructs a new, empty button group with the given parent. |
Method Summary | |
---|---|
void |
addButton(QAbstractButton arg__1)
Adds the given button to the end of the group's internal list of buttons. |
void |
addButton(QAbstractButton arg__1,
int id)
Adds the given button to the button group, with the given id. |
QAbstractButton |
button(int id)
Returns the button with the specified id, or 0 if no such button exists. |
java.util.List |
buttons()
Returns the list of this groups's buttons. |
QAbstractButton |
checkedButton()
Returns the button group's checked button, or 0 if no buttons are checked. |
int |
checkedId()
Returns the id of the checkedButton() , or -1 if no button is checked. |
boolean |
exclusive()
This property holds whether the button group is exclusive. |
int |
id(QAbstractButton button)
Returns the id for the specified button, or -1 if no such button exists. |
void |
removeButton(QAbstractButton arg__1)
Removes the given button from the button group. |
void |
setExclusive(boolean arg__1)
This property holds whether the button group is exclusive. |
void |
setId(QAbstractButton button,
int id)
Sets the id for the specified button. |
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 com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
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 |
Field Detail |
---|
public final QSignalEmitter.Signal1 buttonClicked
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QAbstractButton(named: button)>:
This signal is emitted when the given button is clicked. A button is clicked when it is first pressed and then released, when its shortcut key is typed, or programmatically when QAbstractButton::click()
or QAbstractButton::animateClick()
is called.
checkedButton()
, and QAbstractButton::clicked()
.
public final QSignalEmitter.Signal1 buttonIdClicked
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: arg__1)>:
public final QSignalEmitter.Signal1 buttonPressed
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QAbstractButton(named: button)>:
This signal is emitted when the given button is pressed down.
QAbstractButton::pressed()
.
public final QSignalEmitter.Signal1 buttonIdPressed
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: arg__1)>:
public final QSignalEmitter.Signal1 buttonReleased
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QAbstractButton(named: button)>:
This signal is emitted when the given button is released.
QAbstractButton::released()
.
public final QSignalEmitter.Signal1 buttonIdReleased
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: arg__1)>:
Constructor Detail |
---|
public QButtonGroup()
addButton()
, and setExclusive()
.
public QButtonGroup(QObject parent)
addButton()
, and setExclusive()
.
Method Detail |
---|
public final void addButton(QAbstractButton arg__1)
removeButton()
.
public final void addButton(QAbstractButton arg__1, int id)
removeButton()
, and buttons()
.
public final QAbstractButton button(int id)
public final java.util.List buttons()
addButton()
, and removeButton()
.
public final QAbstractButton checkedButton()
buttonClicked()
.
public final int checkedId()
checkedButton()
, or -1 if no button is checked. setId()
.
public final boolean exclusive()
In an exclusive group, the user cannot uncheck the currently checked button by clicking on it; instead, another button in the group must be clicked to set the new checked button for that group.
By default, this property is true.
public final int id(QAbstractButton button)
setId()
.
public final void removeButton(QAbstractButton arg__1)
addButton()
, and buttons()
.
public final void setExclusive(boolean arg__1)
In an exclusive group, the user cannot uncheck the currently checked button by clicking on it; instead, another button in the group must be clicked to set the new checked button for that group.
By default, this property is true.
public final void setId(QAbstractButton button, int id)
id()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |