17 #ifndef GEPETTO_GUI_SHORTCUT_FACTORY_HH_
18 #define GEPETTO_GUI_SHORTCUT_FACTORY_HH_
22 #include <QMouseEvent>
23 #include <QPushButton>
42 void addBinding(QString widgetName, QString actionName, QAction* action);
49 void writeShortcutsFile();
50 void readShortcutsFile();
52 typedef std::pair<QString, QAction*> Binding;
53 typedef std::list<Binding> BindingList;
54 typedef std::map<QString, BindingList> MapBindings;
56 class ShortcutButton :
public QPushButton {
58 ShortcutButton(QAction* action, QWidget* parent = 0);
62 virtual void mouseDoubleClickEvent(QMouseEvent* event);
63 virtual void keyPressEvent(QKeyEvent* event);
66 QList<int> modifiers_;
70 MapBindings widgetsBindings_;
71 std::map<QString, QKeySequence> saved_;
Definition: shortcut-factory.hh:29
void open()
Open the widget that allows to change the different shortcut.
void addBinding(QString widgetName, QString actionName, QAction *action)
Definition: action-search-bar.hh:27