Gui::Action Class Reference

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

#include <Action.h>

Public Slots

virtual void onActivated ()
 Activates the command. More...
 
virtual void onToggled (bool)
 Sets whether the command is toggled. More...
 

Public Member Functions

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 Action class is the link between Qt's QAction class and FreeCAD's command classes (Command).

So, it is possible to have all actions (from toolbars, menus, ...) implemented in classes instead of many slot methods in the class MainWindow.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ Action() [1/2]

Action::Action ( 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(), and onActivated().

◆ Action() [2/2]

Action::Action ( Command pcCmd,
QAction *  action,
QObject parent 
)

Action takes ownership of the 'action' object.

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

◆ ~Action()

Action::~Action ( )
virtual

Member Function Documentation

◆ action()

◆ addTo()

◆ icon()

◆ isChecked()

bool Action::isChecked ( ) const

◆ onActivated

void Action::onActivated ( )
virtualslot

◆ onToggled

void Action::onToggled ( bool  b)
virtualslot

Sets whether the command is toggled.

References Gui::Command::TriggerAction.

Referenced by setCheckable().

◆ setCheckable()

◆ setChecked()

◆ setEnabled()

◆ setIcon()

◆ setMenuRole()

void Action::setMenuRole ( QAction::MenuRole  menuRole)

◆ setShortcut()

◆ setStatusTip()

◆ setText()

◆ setToolTip()

◆ setVisible()

void Action::setVisible ( bool  b)
virtual

◆ setWhatsThis()

◆ shortcut()

◆ statusTip()

QString Action::statusTip ( ) const

◆ text()

◆ toolTip()

QString Action::toolTip ( ) const

◆ whatsThis()

QString Action::whatsThis ( ) const

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