Qt Toolkit - QActionGroup Class

| Classes - Annotated - Tree - Functions - Home - Structure

# QActionGroup Class Reference

The QActionGroup class combines actions to a group. More...

`#include <qaction.h>`

Inherits QAction.

List of all member functions.

## Public Members

- QActionGroup ( QWidget * parent, const char * name = 0, bool exclusive = TRUE )
- ~QActionGroup ()
- void setExclusive ( bool )
- bool isExclusive () const
- void insert ( QAction * )

## Signals

- void selected ( QAction * )

## Properties

Type | Name | READ | WRITE | Options
--- | --- | --- | --- | ---
bool | exclusive | isExclusive | setExclusive |

## Detailed Description

The QActionGroup class combines actions to a group.

An action group makes it easier to deal with groups of actions. It allows to add, remove or activate its children with a single call and provides radio semantics ("one of many" choice) for toggle actions.

QActionGroup is an action by its own and thus can be treated as such. Standard action functions like addTo(), removeFrom() and setEnabled() are automatically performed on all members of the group, i.e. for example that adding a group to a toolbar creates a tool button for each child action.

Toggle action handling is controlled with the setExclusive() flag, with the default being TRUE. An exclusive group switches off all toggle actions except the one that was activated. This results in a "one of many" choice similar to a group of radio buttons (see QRadioButton). An exclusive group emits the signal selected() whenever the current child action changes.

## Member Function Documentation

### QActionGroup::QActionGroup ( QWidget * parent, const char * name = 0, bool exclusive = TRUE )

Constructs an action group with parent parent and name name.

If exclusive is TRUE, any toggle action that is a member of this group is toggled off by another action being toggled on.

### QActionGroup::~QActionGroup ()

Destroys the object and frees any allocated resources.

### bool QActionGroup::addTo ( QWidget * w ) `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QAction.

### void QActionGroup::insert ( QAction * action )

Inserts action action to the group.

It is not necessary to manually insert actions that have this action group as their parent object.

### bool QActionGroup::isExclusive () const

Returns TRUE if the action group is exclusive, otherwise FALSE.

See also setExclusive().

### bool QActionGroup::removeFrom ( QWidget * w ) `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QAction.

### void QActionGroup::selected ( QAction * ) `[signal]`

This signal is emitted in exclusive groups when the current toggle action changes.

See also setExclusive().

### void QActionGroup::setEnabled ( bool enable ) `[virtual]`

Reimplemented for internal reasons; the API is not affected.

Reimplemented from QAction.

### void QActionGroup::setExclusive ( bool enable )

Sets the action group to be exclusive if enable is TRUE, or to be non-exclusive if enable is FALSE.

In an exclusive group, any toggle action that is a member of this group is toggled off by another action being toggled on.

See also isExclusive().

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):

This file is part of the Qt toolkit, copyright © 1995-2000 Trolltech, all rights reserved.