Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |
The QButtonGroup widget organizes QButton widgets in a group. More...
#include <qbuttongroup.h>
Inherits QGroupBox.
Inherited by QHButtonGroup and QVButtonGroup.
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 the button is clicked. This makes a button group particularly useful when you have several similar buttons and want to connect all their clicked() signals to one slot.
An exclusive button group switches off all toggle buttons except the one that was clicked. A button group is by default non-exclusive. By default, all radio buttons that are inserted will be mutually exclusive even if the button group is non-exclusive. (See setRadioButtonExclusive().)
There are two ways of using a button group:
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 on with setButton(). The number of buttons in the group is returned by count().
See also QButton, QPushButton, QCheckBox, QRadioButton, Widget Appearance and Style, Layout Management and Organizers.
The parent and name arguments are passed to the QWidget constructor.
The parent and name arguments are passed to the QWidget constructor.
The parent and name arguments are passed to the QWidget constructor.
The parent and name arguments are passed to the QWidget constructor.
This signal is emitted when a button in the group is clicked. The id argument is the button's identifier.
See also QButton::clicked() and insert().
Examples: drawdemo/drawdemo.cpp and xform/xform.cpp.
Returns null if the button was not found.
Buttons are normally inserted into a button group automatically by giving 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.
The button is assigned the identifier id or an automatically generated identifier. It works as follows: If id >= 0, this identifier is assigned. If id == -1 (default), the identifier is equal to the number of buttons in the group. If id is any other negative integer, for instance -2, a unique identifier (negative integer <= -2) is generated. No button has an id of -1.
See also find(), remove() and exclusive.
Examples: listbox/listbox.cpp and xform/xform.cpp.
Returns TRUE if the button group is exclusive; otherwise returns FALSE. See the "exclusive" property for details.
Returns TRUE if the radiobuttons in the group are exclusive; otherwise returns FALSE. See the "radioButtonExclusive" property for details.
This function does nothing unless the keyboard focus points to one of the button group members and key is one of Key_Up, Key_Down, Key_Left and Key_Right.
See also insert().
Sets whether the button group is exclusive. See the "exclusive" property for details.
Sets whether the radiobuttons in the group are exclusive. See the "radioButtonExclusive" property for details.
This property holds whether the button group is exclusive.
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.
Set this property's value with setExclusive() and get this property's value with isExclusive().
This property holds whether the radiobuttons in the group are exclusive.
If this property is TRUE (the default), the radiobuttons in the group are treated exclusively.
Set this property's value with setRadioButtonExclusive() and get this property's value with isRadioButtonExclusive().
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.4
|