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>

Public Slots

void onActivated ()
 Activates the command. More...
void onActivated (QAction *)
 Activates the command. More...
void onHovered (QAction *)
void onToggled (bool)
- Public Slots inherited from Gui::Action
virtual void onActivated ()
 Activates the command. More...
virtual void onToggled (bool)
 Sets whether the command is toggled. More...

Public Member Functions

 ActionGroup (Command *pcCmd, QObject *parent=0)
 Constructs an action called name with parent parent. More...
QList< QAction * > actions () const
QAction * addAction (const QString &)
QAction * addAction (QAction *)
void addTo (QWidget *w)
 Adds this action to widget w. More...
int checkedAction () const
bool isExclusive () const
void setCheckedAction (int)
void setDisabled (bool)
void setDropDownMenu (bool b)
void setEnabled (bool)
 Sets whether the action is enabled. More...
void setExclusive (bool)
void setVisible (bool)
virtual ~ActionGroup ()
- Public Member Functions inherited from Gui::Action
QAction * action () const
 Action (Command *pcCmd, QAction *action, QObject *parent)
 Action takes ownership of the 'action' object. More...
 Action (Command *pcCmd, QObject *parent=0)
 Constructs an action called name with parent parent. More...
QIcon icon () const
bool isChecked () const
void setCheckable (bool)
void setChecked (bool, bool no_signal=false)
void setIcon (const QIcon &)
void setMenuRole (QAction::MenuRole menuRole)
void setShortcut (const QString &)
void setStatusTip (const QString &)
void setText (const QString &)
void setToolTip (const QString &)
void setWhatsThis (const QString &)
QKeySequence shortcut () const
QString statusTip () const
QString text () const
QString toolTip () const
QString whatsThis () const
virtual ~Action ()

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.

Werner Mayer

Constructor & Destructor Documentation

◆ ActionGroup()

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

Constructs an action called name with parent parent.

It also stores a pointer to the command object.

References draftgeoutils.intersections::connect(), onActivated(), and onHovered().

◆ ~ActionGroup()

ActionGroup::~ActionGroup ( )

Member Function Documentation

◆ actions()

◆ addAction() [1/2]

QAction * ActionGroup::addAction ( const QString &  text)

References Gui::Action::action().

◆ addAction() [2/2]

◆ addTo()

void ActionGroup::addTo ( QWidget w)

Adds this action to widget w.

Reimplemented from Gui::Action.

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

References Gui::Action::action().

Referenced by Mod.PartDesign.WizardShaft.Shaft.Shaft::equilibrium().

◆ checkedAction()

int ActionGroup::checkedAction ( ) const

◆ isExclusive()

bool ActionGroup::isExclusive ( ) const

◆ onActivated [1/2]

void ActionGroup::onActivated ( )

Activates the command.

References Gui::Command::TriggerAction.

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

◆ onActivated [2/2]

void ActionGroup::onActivated ( QAction *  a)

◆ onHovered

void ActionGroup::onHovered ( QAction *  a)

References Gui::ToolTip::showText().

Referenced by ActionGroup().

◆ onToggled

void ActionGroup::onToggled ( bool  )

References onActivated().

◆ setCheckedAction()

void ActionGroup::setCheckedAction ( int  i)

◆ setDisabled()

void ActionGroup::setDisabled ( bool  b)

◆ setDropDownMenu()

◆ setEnabled()

void ActionGroup::setEnabled ( bool  b)

Sets whether the action is enabled.

Reimplemented from Gui::Action.

References Gui::Action::setEnabled().

Referenced by PathScripts.PathDressupTagGui.HoldingTagMarker::setSelected().

◆ setExclusive()

void ActionGroup::setExclusive ( bool  b)

◆ setVisible()

void ActionGroup::setVisible ( bool  b)

Reimplemented from Gui::Action.

References Gui::Action::setVisible().

The documentation for this class was generated from the following files:
  • Sources/FreeCAD/src/Gui/Action.h
  • Sources/FreeCAD/src/Gui/Action.cpp