HAL
assigned_keybind_map.cpp
Go to the documentation of this file.
3 
4 namespace hal
5 {
6  AssignedKeybindMap* AssignedKeybindMap::inst = nullptr;
7 
9  {
10  if (!inst) inst = new AssignedKeybindMap;
11  return inst;
12  }
13 
15  {
16  return mKeybindMap.value(needle);
17  }
18 
19  void AssignedKeybindMap::assign(const QKeySequence& newkey, SettingsItemKeybind *setting, const QKeySequence& oldkey)
20  {
21  if (!oldkey.isEmpty())
22  mKeybindMap.remove(oldkey);
23  mKeybindMap.insert(newkey,setting);
24  }
25 }
A map to keep track of the assigned keybinds.
void assign(const QKeySequence &newkey, SettingsItemKeybind *setting, const QKeySequence &oldkey=QKeySequence())
SettingsItemKeybind * currentAssignment(const QKeySequence &needle) const
static AssignedKeybindMap * instance()
A SettingsItem to modify keybinds.
bool isEmpty() const const