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=nullptr)
 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 setIsMode (bool b)
 
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=nullptr)
 Constructs an action called name with parent parent. More...
 
virtual void addTo (QWidget *w)
 Adds this action to widget w. More...
 
QIcon icon () const
 
bool isChecked () const
 
void setCheckable (bool)
 
void setChecked (bool, bool no_signal=false)
 
virtual void setEnabled (bool)
 Sets whether the action is enabled. More...
 
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 &)
 
virtual void setVisible (bool)
 
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.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ ActionGroup()

ActionGroup::ActionGroup ( Command pcCmd,
QObject parent = nullptr 
)

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 ( )
virtual

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)
virtual

Adds this action to widget w.

Reimplemented from Gui::Action.

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

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 ( )
slot

Activates the command.

References Gui::Command::TriggerAction.

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

◆ onActivated [2/2]

void ActionGroup::onActivated ( QAction *  a)
slot

◆ onHovered

void ActionGroup::onHovered ( QAction *  a)
slot

References Gui::ToolTip::showText().

Referenced by ActionGroup().

◆ onToggled

void ActionGroup::onToggled ( bool  )
slot

References onActivated().

◆ setCheckedAction()

◆ setDisabled()

void ActionGroup::setDisabled ( bool  b)

◆ setDropDownMenu()

◆ setEnabled()

void ActionGroup::setEnabled ( bool  b)
virtual

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)

◆ setIsMode()

void Gui::ActionGroup::setIsMode ( bool  b)

◆ setVisible()

void ActionGroup::setVisible ( bool  b)
virtual

Reimplemented from Gui::Action.

References Gui::Action::setVisible().


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