Version: 6.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes

SUIT_ShortcutMgr Class Reference

Class which manages shortcuts customization.

#include <SUIT_ShortcutMgr.h>

Inheritance diagram for SUIT_ShortcutMgr:
Inheritance graph

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_ShortcutMgrgetShortcutMgr ()
 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_ShortcutMgrmyShortcutMgr = NULL

Constructor & Destructor Documentation

SUIT_ShortcutMgr::SUIT_ShortcutMgr ( ) [protected]
SUIT_ShortcutMgr::~SUIT_ShortcutMgr ( ) [protected, virtual]

Member Function Documentation

void SUIT_ShortcutMgr::Init ( ) [static]
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.

Parameters:
sectionshorcuts section
onif 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 ( )
void SUIT_ShortcutMgr::onActionDestroyed ( QObject obj) [private, slot]

Removes destroyed action from the actions list.

Parameters:
objaction being destroyed

References myShortcutActions, and QtxAction.shortcutActionName().

bool SUIT_ShortcutMgr::eventFilter ( QObject o,
QEvent e 
) [private, virtual]

Redefined from QObject.eventFilter();

References processAction().

void SUIT_ShortcutMgr::processAction ( QtxAction action) [private]
QKeySequence SUIT_ShortcutMgr::getShortcutByActionName ( const QString &  actionName) const [private]
Parameters:
actionNamename of shortcut action in preferences
Returns:
key sequence defined in preferences or empty sequence

References SUIT_Session.resourceMgr(), QtxResourceMgr.sectionsToken(), SUIT_Session.session(), and QtxResourceMgr.value().


Field Documentation

QMultiMap<QString, QtxAction*> SUIT_ShortcutMgr.myShortcutActions [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS