|
|
||||||||||
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.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, QCheckBoxes (normally for non-exclusive button groups), or QRadioButtons. 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<QAbstractButton> |
buttonClicked
This signal is emitted when the given arg__1 is clicked. |
QSignalEmitter.Signal1<java.lang.Integer> |
buttonIdClicked
This signal is emitted when a button with the given arg__1 is clicked. |
QSignalEmitter.Signal1<java.lang.Integer> |
buttonIdPressed
This signal is emitted when a button with the given arg__1 is pressed down. |
QSignalEmitter.Signal1<java.lang.Integer> |
buttonIdReleased
This signal is emitted when a button with the given arg__1 is released. |
QSignalEmitter.Signal1<QAbstractButton> |
buttonPressed
This signal is emitted when the given arg__1 is pressed down. |
QSignalEmitter.Signal1<QAbstractButton> |
buttonReleased
This signal is emitted when the given arg__1 is released. |
Constructor Summary | |
---|---|
QButtonGroup()
Equivalent to QButtonGroup(0). |
|
QButtonGroup(QObject parent)
Constructs a new, empty button group with the given parent. |
Method Summary | |
---|---|
void |
addButton(QAbstractButton arg__1)
Adds the given arg__1 to the end of the group's internal list of buttons. |
void |
addButton(QAbstractButton arg__1,
int id)
Adds the given arg__1 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<QAbstractButton> |
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()
Returns whether the button group is exclusive. |
static QButtonGroup |
fromNativePointer(QNativePointer nativePointer)
This function returns the QButtonGroup instance pointed to by nativePointer |
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 arg__1 from the button group. |
void |
setExclusive(boolean arg__1)
Sets whether the button group is exclusive to arg__1. |
void |
setId(QAbstractButton button,
int id)
Sets the id for the specified button. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<QAbstractButton> buttonClicked
This signal is emitted when the given arg__1 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.
public final QSignalEmitter.Signal1<java.lang.Integer> buttonIdClicked
This signal is emitted when a button with the given arg__1 is clicked.
public final QSignalEmitter.Signal1<java.lang.Integer> buttonIdPressed
This signal is emitted when a button with the given arg__1 is pressed down.
public final QSignalEmitter.Signal1<QAbstractButton> buttonPressed
This signal is emitted when the given arg__1 is pressed down.
public final QSignalEmitter.Signal1<QAbstractButton> buttonReleased
This signal is emitted when the given arg__1 is released.
public final QSignalEmitter.Signal1<java.lang.Integer> buttonIdReleased
This signal is emitted when a button with the given arg__1 is released.
Constructor Detail |
---|
public QButtonGroup()
Equivalent to QButtonGroup(0).
public QButtonGroup(QObject parent)
Constructs a new, empty button group with the given parent.
Method Detail |
---|
public final void addButton(QAbstractButton arg__1, int id)
Adds the given arg__1 to the button group, with the given id.
public final void addButton(QAbstractButton arg__1)
Adds the given arg__1 to the end of the group's internal list of buttons.
public final QAbstractButton button(int id)
Returns the button with the specified id, or 0 if no such button exists.
public final java.util.List<QAbstractButton> buttons()
Returns the list of this groups's buttons. This may be empty.
public final QAbstractButton checkedButton()
Returns the button group's checked button, or 0 if no buttons are checked.
public final int checkedId()
Returns the id of the checkedButton, or -1 if no button is checked.
public final boolean exclusive()
Returns whether the button group is exclusive.
If this property is true then only one button in the group can be checked at any given time. The user can click on any button to check it, and that button will replace the existing one as the checked button in the group.
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)
Returns the id for the specified button, or -1 if no such button exists.
public final void removeButton(QAbstractButton arg__1)
Removes the given arg__1 from the button group.
public final void setExclusive(boolean arg__1)
Sets whether the button group is exclusive to arg__1.
If this property is true then only one button in the group can be checked at any given time. The user can click on any button to check it, and that button will replace the existing one as the checked button in the group.
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)
Sets the id for the specified button.
public static QButtonGroup fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |