A button group widget makes it easier to deal with groups of buttons. Each button in a button group has a unique identifier. The button group emits a clicked() signal with this identifier when a button in the group is clicked. This makes a button group particularly useful when you have several similar buttons and want to connect all their clicked() signals to a single slot.
.PP
An exclusive button group switches off all toggle buttons except the one that was clicked. A button group is, by default, non-exclusive. Note that all radio buttons that are inserted into a button group are mutually exclusive even if the button group is non-exclusive. (See setRadioButtonExclusive().)
The button group is the parent widget of a number of buttons, i.e. the button group is the parent argument in the button constructor. The buttons are assigned identifiers 0, 1, 2, etc., in the order they are created. A TQButtonGroup can display a frame and a title because it inherits TQGroupBox.
The button group is an invisible widget and the contained buttons have some other parent widget. In this usage, each button must be manually inserted, using insert(), into the button group and given an identifier.
.PP
A button can be removed from the group with remove(). A pointer to a button with a given id can be obtained using find(). The id of a button is available using id(). A button can be set \fIon\fR with setButton(). The number of buttons in the group is returned by count().
Inserts the \fIbutton\fR with the identifier \fIid\fR into the button group. Returns the button identifier.
.PP
Buttons are normally inserted into a button group automatically by passing the button group as the parent when the button is constructed. So it is not necessary to manually insert buttons that have this button group as their parent widget. An exception is when you want custom identifiers instead of the default 0, 1, 2, etc., or if you want the buttons to have some other parent.
.PP
The button is assigned the identifier \fIid\fR or an automatically generated identifier. It works as follows: If \fIid\fR >= 0, this identifier is assigned. If \fIid\fR == -1 (default), the identifier is equal to the number of buttons in the group. If \fIid\fR is any other negative integer, for instance -2, a unique identifier (negative integer <= -2) is generated. No button has an id of -1.
Moves the keyboard focus according to \fIkey\fR, and if appropriate checks the new focus item.
.PP
This function does nothing unless the keyboard focus points to one of the button group members and \fIkey\fR is one of Key_Up, Key_Down, Key_Left and Key_Right.
Sets whether the radio buttons in the group are exclusive. See the "radioButtonExclusive" property for details.
.SS "Property Documentation"
.SH "bool exclusive"
This property holds whether the button group is exclusive.
.PP
If this property is TRUE, then the buttons in the group are toggled, and to untoggle a button you must click on another button in the group. The default value is FALSE.
.PP
Set this property's value with setExclusive() and get this property's value with isExclusive().
.SH "bool radioButtonExclusive"
This property holds whether the radio buttons in the group are exclusive.
.PP
If this property is TRUE (the default), the radiobuttons in the group are treated exclusively.
.PP
Set this property's value with setRadioButtonExclusive() and get this property's value with isRadioButtonExclusive().
.SH "int selectedId"
This property holds the selected toggle button.
.PP
The toggle button is specified as an ID.
.PP
If no toggle button is selected, this property holds -1.
.PP
If setButton() is called on an exclusive group, the button with the given id will be set to on and all the others will be set to off.
.PP
See also selected().
.PP
Set this property's value with setButton() and get this property's value with selectedId().