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

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!

Constructor & Destructor Documentation

◆ ShortcutController() [1/2]

A constructor.

Creates a new Instance of this class.

◆ 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

◆ ~ShortcutController()

A destructor.

Member Function Documentation

◆ getAllActions()

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

Returns a Hashtable with all Actions saved.

Returns
QHash with all Actions

◆ getAllRegisteredShortcuts()

QHash< QString, QKeySequence > getAllRegisteredShortcuts ( )

Returns a Hashtable with all registered Shortcuts.

Returns
QHash with all registered Shortcuts

◆ getAllShortcuts()

QHash< QString, QKeySequence > getAllShortcuts ( )

Returns a Hashtable with all existing Shortcuts.

Returns
QHash with all Shortcuts

◆ 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

◆ 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

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