ShortcutController Class Reference

The class ShortcutController manages all shortcuts that can be set in the widget. More...

#include <MemoryX/gui-plugins/SceneEditor/gui/ShortcutController.h>

Public Member Functions

QHash< QString, QPointer< QAction > > getAllActions ()
 Returns a Hashtable with all Actions saved. More...
 
QHash< QString, QKeySequence > getAllRegisteredShortcuts ()
 Returns a Hashtable with all registered Shortcuts. More...
 
QHash< QString, QKeySequence > getAllShortcuts ()
 Returns a Hashtable with all existing Shortcuts. More...
 
void registerAction (const QString &name, const QPointer< QAction > &action)
 Registers a QAction, so this action can be given a shortcut. More...
 
 ShortcutController ()
 A constructor. More...
 
 ShortcutController (const QHash< QString, QKeySequence > &initialShortcuts)
 A constructor. More...
 
void updateShortcut (const QString &name, const QKeySequence &keysequence)
 Sets the given QKeySequence as Shortcut for the QAction specified by name. More...
 
 ~ShortcutController ()
 A destructor. More...
 

Detailed Description

The class ShortcutController manages all shortcuts that can be set in the widget.

Each QAction registers its shortcut (if desired) over the ShortcutController.

QApplication must be initialized for this class to work!

Definition at line 50 of file ShortcutController.h.

Constructor & Destructor Documentation

◆ ShortcutController() [1/2]

A constructor.

Creates a new Instance of this class.

Definition at line 34 of file ShortcutController.cpp.

◆ ShortcutController() [2/2]

ShortcutController ( const QHash< QString, QKeySequence > &  initialShortcuts)

A constructor.

Creates a new Instance of this class with already defined initial Shortcuts.

Parameters
initialShortcutsList of already defined Shortcuts

Definition at line 40 of file ShortcutController.cpp.

◆ ~ShortcutController()

A destructor.

Definition at line 46 of file ShortcutController.cpp.

Member Function Documentation

◆ getAllActions()

QHash< QString, QPointer< QAction > > getAllActions ( )

Returns a Hashtable with all Actions saved.

Returns
QHash with all Actions

Definition at line 115 of file ShortcutController.cpp.

◆ getAllRegisteredShortcuts()

QHash< QString, QKeySequence > getAllRegisteredShortcuts ( )

Returns a Hashtable with all registered Shortcuts.

Returns
QHash with all registered Shortcuts

Definition at line 99 of file ShortcutController.cpp.

◆ getAllShortcuts()

QHash< QString, QKeySequence > getAllShortcuts ( )

Returns a Hashtable with all existing Shortcuts.

Returns
QHash with all Shortcuts

Definition at line 94 of file ShortcutController.cpp.

◆ registerAction()

void registerAction ( const QString &  name,
const QPointer< QAction > &  action 
)

Registers a QAction, so this action can be given a shortcut.

Parameters
nameName of the registered QAction
actionQAction to be registered

Definition at line 50 of file ShortcutController.cpp.

◆ updateShortcut()

void updateShortcut ( const QString &  name,
const QKeySequence &  keysequence 
)

Sets the given QKeySequence as Shortcut for the QAction specified by name.

Parameters
nameSpecifies the QAction edited
keysequenceThe QKeySequence that is added to the QAction

Definition at line 67 of file ShortcutController.cpp.


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