Gui::ActionGroup Class Reference

The ActionGroup class is the link between Qt's QActionGroup class and FreeCAD's command classes (Command). More...

#include <Action.h>

Inheritance diagram for Gui::ActionGroup:
Gui::Action Gui::RecentFilesAction Gui::WindowAction Gui::WorkbenchGroup

List of all members.

Public Slots

void onActivated (QAction *)
 Activates the command.
void onActivated ()
 Activates the command.

Public Member Functions

 ActionGroup (Command *pcCmd, QObject *parent=0)
 Constructs an action called name with parent parent.
QList< QAction * > actions () const
QAction * addAction (const QString &)
void addTo (QWidget *w)
 Adds this action to widget w.
int checkedAction () const
void setCheckedAction (int)
void setDisabled (bool)
void setDropDownMenu (bool b)
void setEnabled (bool)
 Sets whether the action is enabled.
void setExclusive (bool)
void setVisible (bool)
virtual ~ActionGroup ()

Protected Attributes

bool _dropDown
QActionGroup * _group

Detailed Description

The ActionGroup class is the link between Qt's QActionGroup class and FreeCAD's command classes (Command).

Compared to Action with an ActionGroup it is possible to implement a single command with a group of toggable actions where e.g. one is set exclusive.

Author:
Werner Mayer

Definition at line 88 of file Action.h.


Constructor & Destructor Documentation

ActionGroup::ActionGroup ( Command pcCmd,
QObject *  parent = 0 
)

Constructs an action called name with parent parent.

It also stores a pointer to the command object.

Definition at line 190 of file Action.cpp.

References _group, draftlibs::fcgeo::connect(), and onActivated().

ActionGroup::~ActionGroup (  )  [virtual]

Definition at line 197 of file Action.cpp.

References _group.


Member Function Documentation

QList< QAction * > ActionGroup::actions (  )  const
QAction * ActionGroup::addAction ( const QString &  text  ) 
void ActionGroup::addTo ( QWidget *  w  )  [virtual]

Adds this action to widget w.

Reimplemented from Gui::Action.

Reimplemented in Gui::WorkbenchGroup, and Gui::WindowAction.

Definition at line 205 of file Action.cpp.

References Gui::Action::_action, _dropDown, and _group.

int ActionGroup::checkedAction (  )  const

Definition at line 272 of file Action.cpp.

References _group.

Referenced by StdViewDockUndockFullscreen::isActive().

void ActionGroup::onActivated ( QAction *  a  )  [slot]

Activates the command.

Definition at line 294 of file Action.cpp.

References _group, Gui::Action::_pcCmd, and Gui::Command::invoke().

void ActionGroup::onActivated (  )  [virtual, slot]

Activates the command.

Reimplemented from Gui::Action.

Definition at line 286 of file Action.cpp.

References Gui::Action::_pcCmd, and Gui::Command::invoke().

Referenced by ActionGroup(), and Gui::WorkbenchGroup::addTo().

void ActionGroup::setCheckedAction ( int  i  ) 

Definition at line 278 of file Action.cpp.

References _group.

Referenced by StdViewDockUndockFullscreen::isActive().

void ActionGroup::setDisabled ( bool  b  ) 

Definition at line 242 of file Action.cpp.

References _group, and setEnabled().

void Gui::ActionGroup::setDropDownMenu ( bool  b  )  [inline]
void ActionGroup::setEnabled ( bool  b  )  [virtual]

Sets whether the action is enabled.

Reimplemented from Gui::Action.

Definition at line 236 of file Action.cpp.

References _group.

Referenced by setDisabled().

void ActionGroup::setExclusive ( bool  b  ) 

Definition at line 248 of file Action.cpp.

References _group.

void ActionGroup::setVisible ( bool  b  )  [virtual]

Reimplemented from Gui::Action.

Definition at line 253 of file Action.cpp.

References _group.


Member Data Documentation

bool Gui::ActionGroup::_dropDown [protected]

Definition at line 114 of file Action.h.

Referenced by addTo().

QActionGroup* Gui::ActionGroup::_group [protected]

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

Generated on Wed Nov 23 19:01:58 2011 for FreeCAD by  doxygen 1.6.1