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 (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 |
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.
Definition at line 88 of file Action.h.
| 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.
| QList< QAction * > ActionGroup::actions | ( | ) | const |
Definition at line 267 of file Action.cpp.
References _group.
Referenced by StdCmdFreezeViews::activated(), StdCmdFreezeViews::createAction(), StdCmdDrawStyle::languageChange(), StdCmdFreezeViews::languageChange(), and CmdDrawingNewPage::languageChange().
| QAction * ActionGroup::addAction | ( | const QString & | text | ) |
Definition at line 259 of file Action.cpp.
References _group.
Referenced by StdCmdWindowsMenu::createAction(), StdViewDockUndockFullscreen::createAction(), StdCmdDrawStyle::createAction(), StdCmdFreezeViews::createAction(), and CmdDrawingNewPage::createAction().
| 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] |
Definition at line 102 of file Action.h.
Referenced by StdViewDockUndockFullscreen::createAction(), StdCmdDrawStyle::createAction(), StdCmdFreezeViews::createAction(), StdCmdRecentFiles::createAction(), and CmdDrawingNewPage::createAction().
| 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] |
bool Gui::ActionGroup::_dropDown [protected] |
QActionGroup* Gui::ActionGroup::_group [protected] |
Definition at line 113 of file Action.h.
Referenced by ActionGroup(), actions(), addAction(), Gui::WindowAction::addTo(), Gui::WorkbenchGroup::addTo(), addTo(), checkedAction(), onActivated(), Gui::WorkbenchGroup::refreshWorkbenchList(), Gui::RecentFilesAction::resizeList(), setCheckedAction(), setDisabled(), setEnabled(), setExclusive(), setVisible(), Gui::WorkbenchGroup::slotAddWorkbench(), Gui::WorkbenchGroup::slotRemoveWorkbench(), Gui::WorkbenchGroup::WorkbenchGroup(), and ~ActionGroup().
1.6.1