The QButtonGroup widget organizes QButton widgets in a group. More...
#include <qbuttongroup.h>
Inherits QGroupBox.
A button group widget makes it easier to deal with groups of buttons. A button in a button group is associated with a unique identifer. The button group emits a clicked() signal with this identifier when the button is clicked. Thus, a button group is an ideal solution when you have several similar buttons and want to connect all their clicked() signals, for example, 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, however, it automatically becomes an exclusive group when a QRadioButton is inserted.
There are two ways of using a button group:
By default, the button group's setFont() and setPalette() functions do not change the appearance of the buttons, but you can use setFontPropagation() and setPalettePropagation() to change that.
See also: QButton, QPushButton, QCheckBox and QRadioButton.
Examples: drawdemo/drawdemo.cpp xform/xform.cpp pref/pref.cpp widgets/widgets.cpp
Constructs a button group with no title.
The parent and name arguments are passed to the QWidget constructor.
Constructs a button group with a title.
The parent and name arguments are passed to the QWidget constructor.
Destroys the button group and its child widgets.
[protected slot]
For internal use only.
[protected slot]
For internal use only.
[protected slot]
For internal use only.
[protected slot]
For internal use only.
[signal]
This signal is emitted when a button in the group is clicked. The id argument is the button's identifier.
Finds and returns a pointer to the button with the specified identifier id.
Returns null if the button was not found.
Inserts a button with the identifier id into the button group. Returns the button identifier.
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.
Inserting several buttons with id = -1 assigns the identifers 0, 1, 2, etc.
This function calls setExclusive(TRUE) if button is a QRadioButton.
See also: find(), remove() and setExclusive().
Returns TRUE if the button group is exclusive, otherwise FALSE.
See also: setExclusive().
[signal]
This signal is emitted when a button in the group is pressed. The id argument is the button's identifier.
[signal]
This signal is emitted when a button in the group is released. The id argument is the button's identifier.
Removes a button from the button group.
See also: insert().
Sets the button with id id to be on, and if this is an exclusive group, all other button in the group to be off.
Sets the button group to be exclusive if enable is TRUE, or to be non-exclusive if enable is FALSE.
An exclusive button group switches off all other toggle buttons when one is switched on. This is ideal for groups of radio buttons A non-exclusive group allow many buttons to be swithed on at the same time.
The default setting is FALSE. A button group automatically becomes an exclusive group when a QRadioButton is inserted.
See also: isExclusive().
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright İ 1998 Troll Tech | Trademarks | Qt version 1.42
|