casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
casa::QtActionGroup Class Reference

This class meant to be used almost identically to an exclusive QActionGroup. More...

#include <QtActionGroup.qo.h>

Inheritance diagram for casa::QtActionGroup:
casa::QtActionSynchronizer

Public Slots

void setEnabled (bool enabled)
 Sets all actions to enabled. More...
 
void setDisabled (bool disabled)
 Sets all actions to disabled. More...
 

Signals

void hovered (QAction *action)
 See QActionGroup::hovered(). More...
 
void triggered (QAction *action)
 See QActionGroup::triggered(). More...
 
void unchecked ()
 This signals is emitted when all actions in the group have been unchecked. More...
 

Public Member Functions

 QtActionGroup (QObject *parent=NULL)
 Constructor that optionally takes a parent object. More...
 
 ~QtActionGroup ()
 Destructor. More...
 
QList< QAction * > actions () const
 See QActionGroup::actions(). More...
 
QAction * checkedAction () const
 See QActionGroup::checkedAction(). More...
 
QAction * addAction (QAction *action)
 See QActionGroup::addAction(). More...
 
void removeAction (QAction *action)
 See QActionGroup::removeAction(). More...
 
bool isEnabled () const
 See QActionGroup::isEnabled(). More...
 
void synchronize (QAction *action, QAbstractButton *button)
 Overrides QtActionSynchronizer::synchronize to only allow actions that are in the group. More...
 
void synchronize (QAction *action, QAction *otherAction)
 
- Public Member Functions inherited from casa::QtActionSynchronizer
 QtActionSynchronizer (QObject *parent=NULL)
 Constructor which takes an optional parent. More...
 
virtual ~QtActionSynchronizer ()
 Destructor. More...
 
virtual void unsynchronize (QAction *action)
 Unsynchronizes all buttons/actions associated with the given in this group. More...
 
virtual void unsynchronize (QAbstractButton *button)
 
virtual void unsynchronize (QAction *action, QAbstractButton *button)
 Unsyncrhonizes the given action in this group with the given button/action. More...
 
virtual void unsynchronize (QAction *action, QAction *otherAction)
 

Private Slots

void actionHovered ()
 Slot for QAction::hover(). More...
 
void actionTriggered (bool checked)
 Slot for QAction::triggered(), which calls actionTriggered_ as needed. More...
 
void actionToggled (bool checked)
 Slot for QAction::toggled(), which calls actionTriggered_ as needed. More...
 

Private Member Functions

void action_ (QAction *action, bool checked)
 Enforces mutual exclusivity and emits signals as needed. More...
 

Private Attributes

bool isEnabled_
 Enabled flag. More...
 
QAction * itsCheckedAction_
 Currently checked action, or NULL if none are checked. More...
 
QList< QAction * > itsActions_
 Actions in group. More...
 

Additional Inherited Members

- Protected Slots inherited from casa::QtActionSynchronizer
virtual void actionToggled (bool checked)
 Slot for when an action is toggled, which calls actionTriggered_() as needed. More...
 
virtual void actionTriggered (bool checked)
 Slot for when an action is triggered, which calls actionTriggered_() as needed. More...
 
virtual void synchronizedToggled (bool checked)
 Slot for when a synchronizing button/action is toggled, which calls synchronizedTriggered_() as needed. More...
 
virtual void synchronizedTriggered (bool checked)
 Slot for when a synchronizing button/action is clicked/triggered, which calls synchronizedTriggered_() as needed. More...
 
- Protected Member Functions inherited from casa::QtActionSynchronizer
virtual void actionTriggered_ (QAction *action, bool checked)
 Method which updates the actions/buttons associated with the given action. More...
 
virtual void synchronizedTriggered_ (QAction *action, QAbstractButton *button, bool checked)
 Method which updates the action(s) associated with the given action or button to the given checked state. More...
 
- Protected Attributes inherited from casa::QtActionSynchronizer
QMultiMap< QAction
*, QAbstractButton * > 
itsSynchedButtons_
 Synchronized actions maps. More...
 
QMultiMap< QAction *, QAction * > itsSynchedActions_
 

Detailed Description

This class meant to be used almost identically to an exclusive QActionGroup.

The difference is that this class allows all QActions to be unchecked; in other words, either one action is checked or none are. Some methods from QActionGroup have not been included, but they would be easy to include if desired. This class also has the added functionality included in QtActionSynchronnizer.

Definition at line 116 of file QtActionGroup.qo.h.

Constructor & Destructor Documentation

casa::QtActionGroup::QtActionGroup ( QObject *  parent = NULL)

Constructor that optionally takes a parent object.

casa::QtActionGroup::~QtActionGroup ( )

Destructor.

Member Function Documentation

void casa::QtActionGroup::action_ ( QAction *  action,
bool  checked 
)
private

Enforces mutual exclusivity and emits signals as needed.

void casa::QtActionGroup::actionHovered ( )
privateslot

Slot for QAction::hover().

QList<QAction*> casa::QtActionGroup::actions ( ) const

See QActionGroup::actions().

void casa::QtActionGroup::actionToggled ( bool  checked)
privateslot

Slot for QAction::toggled(), which calls actionTriggered_ as needed.

void casa::QtActionGroup::actionTriggered ( bool  checked)
privateslot

Slot for QAction::triggered(), which calls actionTriggered_ as needed.

QAction* casa::QtActionGroup::addAction ( QAction *  action)

See QActionGroup::addAction().

QAction* casa::QtActionGroup::checkedAction ( ) const

See QActionGroup::checkedAction().

Will return NULL if no action is currently checked.

void casa::QtActionGroup::hovered ( QAction *  action)
signal

See QActionGroup::hovered().

bool casa::QtActionGroup::isEnabled ( ) const

See QActionGroup::isEnabled().

void casa::QtActionGroup::removeAction ( QAction *  action)

See QActionGroup::removeAction().

void casa::QtActionGroup::setDisabled ( bool  disabled)
inlineslot

Sets all actions to disabled.

Definition at line 154 of file QtActionGroup.qo.h.

void casa::QtActionGroup::setEnabled ( bool  enabled)
slot

Sets all actions to enabled.

void casa::QtActionGroup::synchronize ( QAction *  action,
QAbstractButton *  button 
)
virtual

Overrides QtActionSynchronizer::synchronize to only allow actions that are in the group.

Reimplemented from casa::QtActionSynchronizer.

void casa::QtActionGroup::synchronize ( QAction *  action,
QAction *  otherAction 
)
virtual

Reimplemented from casa::QtActionSynchronizer.

void casa::QtActionGroup::triggered ( QAction *  action)
signal

See QActionGroup::triggered().

void casa::QtActionGroup::unchecked ( )
signal

This signals is emitted when all actions in the group have been unchecked.

Member Data Documentation

bool casa::QtActionGroup::isEnabled_
private

Enabled flag.

Definition at line 169 of file QtActionGroup.qo.h.

QList<QAction*> casa::QtActionGroup::itsActions_
private

Actions in group.

Definition at line 175 of file QtActionGroup.qo.h.

QAction* casa::QtActionGroup::itsCheckedAction_
private

Currently checked action, or NULL if none are checked.

Definition at line 172 of file QtActionGroup.qo.h.


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