Manager for StelAction instances. Allows registration of new actions, and finding an existing one by name.
#include <StelActionMgr.hpp>
|
StelAction * | addAction (const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="", bool global=false) |
| Create and add a new StelAction, connected to an object property or slot. More...
|
|
StelAction * | findAction (const QString &id) |
|
bool | pushKey (int key, bool global=false) |
|
QStringList | getGroupList () const |
| Returns a list of all current StelAction groups.
|
|
QList< StelAction * > | getActionList (const QString &group) const |
| Returns all StelActions in the specified group.
|
|
QList< StelAction * > | getActionList () const |
| Returns all registered StelActions.
|
|
void | saveShortcuts () |
| Save current shortcuts to file.
|
|
void | restoreDefaultShortcuts () |
| Restore the default shortcuts combinations.
|
|
void StelActionMgr::actionToggled |
( |
const QString & |
id, |
|
|
bool |
value |
|
) |
| |
|
signal |
- Parameters
-
id | The id of the action that was toggled |
value | The new value of the action |
StelAction* StelActionMgr::addAction |
( |
const QString & |
id, |
|
|
const QString & |
groupId, |
|
|
const QString & |
text, |
|
|
QObject * |
target, |
|
|
const char * |
slot, |
|
|
const QString & |
shortcut = "" , |
|
|
const QString & |
altShortcut = "" , |
|
|
bool |
global = false |
|
) |
| |
- Parameters
-
id | Global identifier. |
groupId | Group identifier. |
text | Short human-readable description in English. |
target | The QObject the action is linked to. |
slot | The target slot or property that the action will trigger. Either a slot name of the form 'func()' and in that case the action is made non checkable, a slot name of the form 'func(bool)' and in that case the action is made checkable, or a property name and in that case the action is made checkable. |
shortcut | Default shortcut/key combination for this action |
altShortcut | Alternative shortcut |
global | determines QAction shortcut context (not necessary anymore?) |
void StelActionMgr::setAllActionsEnabled |
( |
bool |
value | ) |
|
|
inlineslot |
need for editing shortcuts without trigging any actions