29 #include <QKeySequence>
42 shortcuts(initialShortcuts)
52 if (registeredActions.contains(name))
54 throw std::invalid_argument(
"Action already registered");
57 if (!shortcuts.contains(name))
59 QKeySequence keySequence(
"");
60 shortcuts.insert(name, keySequence);
63 action->setShortcut(shortcuts.value(name));
64 registeredActions.insert(name, action);
69 if (keysequence.toString() !=
"" && shortcuts.key(keysequence) != NULL)
74 if (shortcuts.contains(name))
76 shortcuts[name] = keysequence;
78 if (registeredActions.contains(name))
80 registeredActions.value(name)->setShortcut(keysequence);
85 shortcuts.insert(name, keysequence);
88 if (registeredActions.contains(name))
90 registeredActions.value(name)->setShortcut(keysequence);
101 QHash<QString, QKeySequence> tempShortcuts;
102 QHash<QString, QKeySequence>::iterator i;
104 for (i = shortcuts.begin(); i != shortcuts.end(); ++i)
106 if (registeredActions.contains(i.key()))
108 tempShortcuts.insert(i.key(), i.value());
112 return tempShortcuts;
117 return registeredActions;