Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Friends | Related Functions

QButtonGroup Class Reference

The QButtonGroup class provides a container to organize groups of button widgets. More...

Inheritance diagram for QButtonGroup:
Inheritance graph
Collaboration diagram for QButtonGroup:
Collaboration graph

List of all members.

Public Slots

void deleteLater ()


void buttonClicked (QAbstractButton *)
void buttonClicked (int)
void buttonPressed (int)
void buttonPressed (QAbstractButton *)
void buttonReleased (int)
void buttonReleased (QAbstractButton *)
void destroyed (QObject *=0)

Public Member Functions

void addButton (QAbstractButton *)
void addButton (QAbstractButton *, int id)
bool blockSignals (bool b)
QAbstractButtonbutton (int id) const
QList< QAbstractButton * > buttons () const
QAbstractButtoncheckedButton () const
int checkedId () const
const QObjectListchildren () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
bool disconnect (const QObject *receiver, const char *member=0)
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
bool exclusive () const
template<typename T >
findChild (const QString &aName=QString()) const
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
template<typename T >
QList< T > findChildren (const QRegExp &re) const
int id (QAbstractButton *button) const
bool inherits (const char *classname) const
void installEventFilter (QObject *)
bool isWidgetType () const
void killTimer (int id)
void moveToThread (QThread *thread)
QString objectName () const
QObjectparent () const
QVariant property (const char *name) const
 QButtonGroup (QObject *parent=0)
void removeButton (QAbstractButton *)
void removeEventFilter (QObject *)
void setExclusive (bool)
void setId (QAbstractButton *button, int id)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
QThreadthread () const
QObjectUserDatauserData (uint id) const
 ~QButtonGroup ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
int receivers (const char *signal) const
QObjectsender () const
virtual void timerEvent (QTimerEvent *)

Protected Attributes


Static Protected Attributes

static const QMetaObject staticQtMetaObject


bool exclusive
 whether the button group is exclusive
QString objectName
 the name of this object


class QAbstractButton
class QAbstractButtonPrivate
class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name)
qFindChildqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
QList< T > qFindChildren (const QObject *obj, const QString &name)
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QRegExp &regExp)()
QList< T > qFindChildrenqFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)()
T * qobject_cast (QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)

Detailed Description

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 {QButtonGroup::exclusive} {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, {QCheckBox}es (normally for non-exclusive button groups), or {QRadioButton}s. 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 id {-1} is reserved by QButtonGroup to mean "no such button". The purpose of the mapping mechanism is to simplify the representation of enum values in a user interface.

See also:
QGroupBox QPushButton, QCheckBox, QRadioButton

Definition at line 59 of file qbuttongroup.h.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index