Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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. More...
 
void updateShortcuts ()
 Update shortcuts from preferences. More...
 

Static Public Member Functions

static void Init ()
 Create new instance of shortcut manager. More...
 
static SUIT_ShortcutMgrgetShortcutMgr ()
 Return shortcut manager. More...
 

Protected Member Functions

 SUIT_ShortcutMgr ()
 Constructor. More...
 
virtual ~SUIT_ShortcutMgr ()
 Destructor. More...
 

Private Slots

void onActionDestroyed (QObject *)
 Called when the corresponding action is destroyed. More...
 

Private Member Functions

virtual bool eventFilter (QObject *o, QEvent *e)
 Custom event filter for qapplication . More...
 
void processAction (QtxAction *)
 Set shortcut to the given action if the shortcut is defined. More...
 
QKeySequence getShortcutByActionName (const QString &) const
 Return key sequence for shortcut action name. More...
 

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 ( )
protectedvirtual

Member Function Documentation

bool SUIT_ShortcutMgr::eventFilter ( QObject o,
QEvent e 
)
privatevirtual

Redefined from QObject::eventFilter();

References processAction().

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().

SUIT_ShortcutMgr * SUIT_ShortcutMgr::getShortcutMgr ( )
static

References Init(), and myShortcutMgr.

void SUIT_ShortcutMgr::Init ( )
static
void SUIT_ShortcutMgr::onActionDestroyed ( QObject obj)
privateslot

Removes destroyed action from the actions list.

Parameters
objaction being destroyed

References myShortcutActions, and QtxAction::shortcutActionName().

void SUIT_ShortcutMgr::processAction ( QtxAction action)
private
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(), app, SUIT_Application::desktop(), myShortcutActions, SUIT_Session::session(), and QtxAction::shortcutActionName().

void SUIT_ShortcutMgr::updateShortcuts ( )

Member Data Documentation

QMultiMap<QString, QtxAction*> SUIT_ShortcutMgr::myShortcutActions
private
SUIT_ShortcutMgr * SUIT_ShortcutMgr::myShortcutMgr = NULL
staticprivate

The documentation for this class was generated from the following files: