#ifndef DYNAMICSHORTCUTSOVERVIEW_H #define DYNAMICSHORTCUTSOVERVIEW_H #include class QGridLayout; class ShortcutCatcher; typedef QPair ActionBinding; class DynamicShortcutsWidget : public QWidget { Q_OBJECT public: // Constructors and destructors. explicit DynamicShortcutsWidget(QWidget *parent = 0); virtual ~DynamicShortcutsWidget(); // Updates shortcuts of all actions according to changes. // NOTE: No access to settings is done here. // Shortcuts are fetched from settings when applications starts // and stored back to settings when application quits. void updateShortcuts(); // Returns true if all shortcuts are unique, // otherwise false. bool areShortcutsUnique(); // Populates this widget with shortcut widgets for given actions. // NOTE: This gets initial shortcut for each action from its properties, NOT from // the application settings, so shortcuts from settings need to be // assigned to actions before calling this method. void populate(const QList actions); private: QGridLayout *m_layout; QList m_actionBindings; }; #endif // DYNAMICSHORTCUTSOVERVIEW_H