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 () |
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.
Constructs an action called name with parent parent.
It also stores a pointer to the command object.
References draftgeoutils.intersections::connect(), and onActivated().
Action takes ownership of the 'action' object.
References draftgeoutils.intersections::connect(), and onActivated().
|
virtual |
QAction * Gui::Action::action | ( | ) | const |
|
virtual |
Adds this action to widget w.
Reimplemented in Gui::ActionGroup, Gui::WorkbenchGroup, Gui::UndoAction, Gui::RedoAction, Gui::DockWidgetAction, Gui::ToolBarAction, and Gui::WindowAction.
Referenced by Mod.PartDesign.WizardShaft.Shaft.Shaft::equilibrium(), FemGui::TaskPostClip::TaskPostClip(), and FemGui::TaskPostCut::TaskPostCut().
QIcon Action::icon | ( | ) | const |
Referenced by addonmanager_macro.Macro::clean_icon(), addonmanager_macro.Macro::fill_details_from_wiki(), PathScripts.PathIconViewProvider.ViewProvider::getIcon(), PathScripts.PathOpGui.TaskPanelPage::getIcon(), addonmanager_macro.Macro::install(), addonmanager_macro.Macro::parse_wiki_page_for_icon(), addonmanager_macro.Macro::remove(), and setIcon().
bool Action::isChecked | ( | ) | const |
|
virtualslot |
Activates the command.
References Gui::Command::TriggerAction.
Referenced by Action(), Gui::RedoAction::RedoAction(), setCheckable(), and Gui::UndoAction::UndoAction().
|
virtualslot |
Sets whether the command is toggled.
References Gui::Command::TriggerAction.
Referenced by setCheckable().
void Action::setCheckable | ( | bool | b | ) |
References draftgeoutils.intersections::connect(), onActivated(), and onToggled().
Referenced by Gui::GroupCommand::createAction(), Gui::PythonCommand::createAction(), Gui::PythonGroupCommand::createAction(), StdOrthographicCamera::createAction(), StdPerspectiveCamera::createAction(), StdCmdToggleClipPlane::createAction(), StdCmdSelBoundingBox::createAction(), StdCmdStatusBar::createAction(), and Gui::StdCmdDescription::createAction().
|
virtual |
Sets whether the action is enabled.
Reimplemented in Gui::ActionGroup, Gui::UndoAction, and Gui::RedoAction.
Referenced by Gui::ActionGroup::setDisabled(), Gui::ActionGroup::setEnabled(), Gui::UndoAction::setEnabled(), Gui::RedoAction::setEnabled(), and PathScripts.PathDressupTagGui.HoldingTagMarker::setSelected().
void Action::setIcon | ( | const QIcon & | icon | ) |
References icon().
Referenced by Gui::PythonGroupCommand::activated(), Gui::StdCmdDownloadOnlineHelp::createAction(), Gui::Command::createAction(), Gui::PythonCommand::createAction(), Gui::PythonGroupCommand::createAction(), Gui::MacroCommand::createAction(), StdCmdUndo::createAction(), StdCmdRedo::createAction(), StdCmdWorkbench::createAction(), StdCmdAbout::createAction(), StdCmdUserEditMode::createAction(), StdCmdDrawStyle::createAction(), Gui::ActionGroup::onActivated(), Gui::ActionGroup::setCheckedAction(), Gui::GroupCommand::setup(), CmdSketcherConstrainLock::updateAction(), CmdSketcherConstrainDistance::updateAction(), CmdSketcherConstrainDistanceX::updateAction(), CmdSketcherConstrainDistanceY::updateAction(), CmdSketcherConstrainRadius::updateAction(), CmdSketcherConstrainDiameter::updateAction(), CmdSketcherConstrainRadiam::updateAction(), and CmdSketcherConstrainAngle::updateAction().
void Action::setMenuRole | ( | QAction::MenuRole | menuRole | ) |
void Action::setShortcut | ( | const QString & | key | ) |
Referenced by Gui::StdCmdDownloadOnlineHelp::createAction(), Gui::Command::createAction(), Gui::PythonCommand::createAction(), Gui::MacroCommand::createAction(), StdCmdUndo::createAction(), StdCmdRedo::createAction(), StdCmdWorkbench::createAction(), StdCmdAbout::createAction(), and Gui::Dialog::DlgCustomKeyboardImp::on_buttonReset_clicked().
void Action::setStatusTip | ( | const QString & | s | ) |
void Action::setText | ( | const QString & | s | ) |
void Action::setToolTip | ( | const QString & | s | ) |
|
virtual |
Reimplemented in Gui::ActionGroup, Gui::UndoAction, and Gui::RedoAction.
Referenced by Gui::ActionGroup::setVisible(), Gui::UndoAction::setVisible(), and Gui::RedoAction::setVisible().
void Action::setWhatsThis | ( | const QString & | s | ) |
QKeySequence Action::shortcut | ( | ) | const |
Referenced by Gui::MacroCommand::createAction(), PathScripts.PathDressupDragknife.ObjectDressup::execute(), Gui::Dialog::DlgCustomKeyboardImp::on_buttonReset_clicked(), Gui::Dialog::DlgCustomKeyboardImp::on_commandTreeWidget_currentItemChanged(), and Gui::Dialog::DlgCustomKeyboardImp::on_editShortcut_textChanged().
QString Action::statusTip | ( | ) | const |
Referenced by Gui::MacroCommand::createAction().
QString Action::text | ( | ) | const |
Referenced by importSVG.svgHandler::characters(), draftguitools.gui_texts.Text::createObject(), draftviewproviders.view_text.ViewProviderText::createObject(), importSVG.svgHandler::endElement(), exportIFCHelper.SIUnitCreator::getSIPrefix(), exportIFCHelper.SIUnitCreator::getSIUnitName(), and Mod.Test.unittestgui.ProgressBar::paint().
QString Action::toolTip | ( | ) | const |
Referenced by Gui::MacroCommand::createAction().
QString Action::whatsThis | ( | ) | const |