Eneboo - Documentación para desarrolladores
|
The QButtonGroup widget organizes QButton widgets in a group. Más...
#include <qbuttongroup.h>
Señales | |
void | pressed (int id) |
void | released (int id) |
void | clicked (int id) |
void | pressed (int id) |
void | released (int id) |
void | clicked (int id) |
Métodos públicos | |
QButtonGroup (QWidget *parent=0, const char *name=0) | |
QButtonGroup (const QString &title, QWidget *parent=0, const char *name=0) | |
QButtonGroup (int columns, Orientation o, QWidget *parent=0, const char *name=0) | |
QButtonGroup (int columns, Orientation o, const QString &title, QWidget *parent=0, const char *name=0) | |
~QButtonGroup () | |
bool | isExclusive () const |
bool | isRadioButtonExclusive () const |
virtual void | setExclusive (bool) |
virtual void | setRadioButtonExclusive (bool) |
int | insert (QButton *, int id=-1) |
void | remove (QButton *) |
QButton * | find (int id) const |
int | id (QButton *) const |
int | count () const |
virtual void | setButton (int id) |
virtual void | moveFocus (int) |
QButton * | selected () const |
int | selectedId () const |
QButtonGroup (QWidget *parent=0, const char *name=0) | |
QButtonGroup (const QString &title, QWidget *parent=0, const char *name=0) | |
QButtonGroup (int columns, Orientation o, QWidget *parent=0, const char *name=0) | |
QButtonGroup (int columns, Orientation o, const QString &title, QWidget *parent=0, const char *name=0) | |
~QButtonGroup () | |
bool | isExclusive () const |
bool | isRadioButtonExclusive () const |
virtual void | setExclusive (bool) |
virtual void | setRadioButtonExclusive (bool) |
int | insert (QButton *, int id=-1) |
void | remove (QButton *) |
QButton * | find (int id) const |
int | id (QButton *) const |
int | count () const |
virtual void | setButton (int id) |
virtual void | moveFocus (int) |
QButton * | selected () const |
int | selectedId () const |
Slots protegidos | |
void | buttonPressed () |
void | buttonReleased () |
void | buttonClicked () |
void | buttonToggled (bool on) |
void | buttonPressed () |
void | buttonReleased () |
void | buttonClicked () |
void | buttonToggled (bool on) |
Métodos protegidos | |
bool | event (QEvent *e) |
bool | event (QEvent *e) |
Propiedades | |
bool | exclusive |
whether the button group is exclusive | |
bool | radioButtonExclusive |
whether the radio buttons in the group are exclusive | |
int | selectedId |
the selected toggle button |
The QButtonGroup widget organizes QButton widgets in a group.
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.
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().)
There are two ways of using a button group: 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 QButtonGroup can display a frame and a title because it inherits QGroupBox. 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.
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().
QButtonGroup::QButtonGroup | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
Constructs a button group with no title.
The parent and name arguments are passed to the QWidget constructor.
Constructs a button group with the title title.
The parent and name arguments are passed to the QWidget constructor.
QButtonGroup::QButtonGroup | ( | int | strips, |
Orientation | orientation, | ||
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructs a button group with no title. Child widgets will be arranged in strips rows or columns (depending on orientation).
The parent and name arguments are passed to the QWidget constructor.
QButtonGroup::QButtonGroup | ( | int | strips, |
Orientation | orientation, | ||
const QString & | title, | ||
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
Constructs a button group with title title. Child widgets will be arranged in strips rows or columns (depending on orientation).
The parent and name arguments are passed to the QWidget constructor.
QButtonGroup::~QButtonGroup | ( | ) |
QButtonGroup::QButtonGroup | ( | QWidget * | parent = 0 , |
const char * | name = 0 |
||
) |
QButtonGroup::QButtonGroup | ( | int | columns, |
Orientation | o, | ||
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
QButtonGroup::QButtonGroup | ( | int | columns, |
Orientation | o, | ||
const QString & | title, | ||
QWidget * | parent = 0 , |
||
const char * | name = 0 |
||
) |
QButtonGroup::~QButtonGroup | ( | ) |
void QButtonGroup::buttonClicked | ( | ) | [protected, slot] |
void QButtonGroup::buttonClicked | ( | ) | [protected, slot] |
void QButtonGroup::buttonPressed | ( | ) | [protected, slot] |
void QButtonGroup::buttonPressed | ( | ) | [protected, slot] |
void QButtonGroup::buttonReleased | ( | ) | [protected, slot] |
void QButtonGroup::buttonReleased | ( | ) | [protected, slot] |
void QButtonGroup::buttonToggled | ( | bool | on | ) | [protected, slot] |
void QButtonGroup::buttonToggled | ( | bool | on | ) | [protected, slot] |
void QButtonGroup::clicked | ( | int | id | ) | [signal] |
void QButtonGroup::clicked | ( | int | id | ) | [signal] |
int QButtonGroup::count | ( | ) | const |
Returns the number of buttons in the group.
int QButtonGroup::count | ( | ) | const |
Returns the button with the specified identifier id, or 0 if the button was not found.
Returns the id of button, or -1 if button is not a member of this group.
Inserts the button with the identifier id into the button group. Returns the button identifier.
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.
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.
bool QButtonGroup::isExclusive | ( | ) | const |
bool QButtonGroup::isExclusive | ( | ) | const |
bool QButtonGroup::isRadioButtonExclusive | ( | ) | const [inline] |
bool QButtonGroup::isRadioButtonExclusive | ( | ) | const [inline] |
virtual void QButtonGroup::moveFocus | ( | int | ) | [virtual] |
void QButtonGroup::moveFocus | ( | int | key | ) | [virtual] |
Moves the keyboard focus according to key, and if appropriate checks the new focus item.
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
.
void QButtonGroup::pressed | ( | int | id | ) | [signal] |
void QButtonGroup::pressed | ( | int | id | ) | [signal] |
void QButtonGroup::released | ( | int | id | ) | [signal] |
void QButtonGroup::released | ( | int | id | ) | [signal] |
void QButtonGroup::remove | ( | QButton * | ) |
void QButtonGroup::remove | ( | QButton * | button | ) |
Removes the button from the button group.
QButton * QButtonGroup::selected | ( | ) | const |
Returns the selected toggle button if exactly one is selected; otherwise returns 0.
QButton* QButtonGroup::selected | ( | ) | const |
int QButtonGroup::selectedId | ( | ) | const |
int QButtonGroup::selectedId | ( | ) | const |
virtual void QButtonGroup::setButton | ( | int | id | ) | [virtual] |
void QButtonGroup::setButton | ( | int | id | ) | [virtual] |
virtual void QButtonGroup::setExclusive | ( | bool | ) | [virtual] |
void QButtonGroup::setExclusive | ( | bool | enable | ) | [virtual] |
void QButtonGroup::setRadioButtonExclusive | ( | bool | on | ) | [virtual] |
virtual void QButtonGroup::setRadioButtonExclusive | ( | bool | ) | [virtual] |
bool QButtonGroup::exclusive [read, write] |
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.
bool QButtonGroup::radioButtonExclusive [read, write] |
whether the radio buttons in the group are exclusive
If this property is TRUE (the default), the radiobuttons in the group are treated exclusively.
int QButtonGroup::selectedId [read, write] |
the selected toggle button
The toggle button is specified as an ID.
If no toggle button is selected, this property holds -1.
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.