Class which manages shortcuts customization.
#include <SUIT_ShortcutMgr.h>

Public Member Functions | |
| void | setSectionEnabled (const QString &, const bool=true) |
| Enable/disable a shortcuts section. | |
| void | updateShortcuts () |
| Update shortcuts from preferences. | |
Static Public Member Functions | |
| static void | Init () |
| Create new instance of shortcut manager. | |
| static SUIT_ShortcutMgr * | getShortcutMgr () |
| Return shortcut manager. | |
Protected Member Functions | |
| SUIT_ShortcutMgr () | |
| Constructor. | |
| virtual | ~SUIT_ShortcutMgr () |
| Destructor. | |
Private Slots | |
| void | onActionDestroyed (QObject *) |
| Called when the corresponding action is destroyed. | |
Private Member Functions | |
| virtual bool | eventFilter (QObject *o, QEvent *e) |
| Custom event filter for qapplication . | |
| void | processAction (QtxAction *) |
| Set shortcut to the given action if the shortcut is defined. | |
| QKeySequence | getShortcutByActionName (const QString &) const |
| Return key sequence for shortcut action name. | |
Private Attributes | |
| QMultiMap< QString, QtxAction * > | myShortcutActions |
Static Private Attributes | |
| static SUIT_ShortcutMgr * | myShortcutMgr = NULL |
| SUIT_ShortcutMgr::SUIT_ShortcutMgr | ( | ) | [protected] |
| SUIT_ShortcutMgr::~SUIT_ShortcutMgr | ( | ) | [protected, virtual] |
| void SUIT_ShortcutMgr::Init | ( | ) | [static] |
References myShortcutMgr, and SUIT_ShortcutMgr().
| SUIT_ShortcutMgr * SUIT_ShortcutMgr::getShortcutMgr | ( | ) | [static] |
References Init(), and myShortcutMgr.
| void SUIT_ShortcutMgr::setSectionEnabled | ( | const QString & | section, |
| const bool | on = true |
||
| ) |
Enables or disables actions which belong to the given shortcuts section. Only actions which have an active desktop as a parent widget are taken into account.
| section | shorcuts section |
| on | if true - action will be enabled, otherwise - disabled |
References SUIT_Session.activeApplication(), SUIT_Application.desktop(), myShortcutActions, SUIT_Session.session(), and QtxAction.shortcutActionName().
| void SUIT_ShortcutMgr::updateShortcuts | ( | ) |
References getShortcutByActionName(), myShortcutActions, and QtxAction.shortcutActionName().
| void SUIT_ShortcutMgr::onActionDestroyed | ( | QObject * | obj | ) | [private, slot] |
Removes destroyed action from the actions list.
| obj | action being destroyed |
References myShortcutActions, and QtxAction.shortcutActionName().
Redefined from QObject.eventFilter();
References processAction().
| void SUIT_ShortcutMgr::processAction | ( | QtxAction * | action | ) | [private] |
| action | action to process |
References getShortcutByActionName(), myShortcutActions, onActionDestroyed(), and QtxAction.shortcutActionName().
| QKeySequence SUIT_ShortcutMgr::getShortcutByActionName | ( | const QString & | actionName | ) | const [private] |
| actionName | name of shortcut action in preferences |
References SUIT_Session.resourceMgr(), QtxResourceMgr.sectionsToken(), SUIT_Session.session(), and QtxResourceMgr.value().
SUIT_ShortcutMgr * SUIT_ShortcutMgr::myShortcutMgr = NULL [static, private] |
QMultiMap<QString, QtxAction*> SUIT_ShortcutMgr.myShortcutActions [private] |