HAL
hal::AssignedKeybindMap Class Reference

A map to keep track of the assigned keybinds. More...

#include <assigned_keybind_map.h>

Collaboration diagram for hal::AssignedKeybindMap:
Collaboration graph

Public Member Functions

void assign (const QKeySequence &newkey, SettingsItemKeybind *setting, const QKeySequence &oldkey=QKeySequence())
 
SettingsItemKeybindcurrentAssignment (const QKeySequence &needle) const
 
void initMap ()
 

Static Public Member Functions

static AssignedKeybindMapinstance ()
 

Detailed Description

A map to keep track of the assigned keybinds.

The AssignedKeybindMap class keeps track of all configured keybinds and maps the sequence to a specific SettingsItemKeybind. It is implemented as a singleton pattern.

Definition at line 43 of file assigned_keybind_map.h.

Member Function Documentation

◆ assign()

void hal::AssignedKeybindMap::assign ( const QKeySequence newkey,
SettingsItemKeybind setting,
const QKeySequence oldkey = QKeySequence() 
)

Maps a (new) keysequence to the corresponding SettingsItemKeybind. If an old key is provided it is first removed from the map.

Parameters
newkey- The (new) key.
setting- The corresponding keybind setting.
oldkey- The old key to be removed from the map.

Definition at line 19 of file assigned_keybind_map.cpp.

References QKeySequence::isEmpty().

Referenced by hal::KeybindEdit::doValidate(), and hal::KeybindEdit::load().

◆ currentAssignment()

SettingsItemKeybind * hal::AssignedKeybindMap::currentAssignment ( const QKeySequence needle) const

Get the keybind item that is associated with the given keysequence.

Parameters
needle- The keysequence for which the keybind item is wanted.
Returns
The assiciated keybind item.

Definition at line 14 of file assigned_keybind_map.cpp.

Referenced by hal::KeybindEdit::doValidate().

◆ initMap()

void hal::AssignedKeybindMap::initMap ( )
inline

Clears all entries from the map.

Definition at line 72 of file assigned_keybind_map.h.

References QMap::clear().

◆ instance()

AssignedKeybindMap * hal::AssignedKeybindMap::instance ( )
static

Get the singleton instance of the AssignedKeybindMap.

Returns
The instance.

Definition at line 8 of file assigned_keybind_map.cpp.

Referenced by hal::KeybindEdit::doValidate(), and hal::KeybindEdit::load().


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