added shortcuts management support

TODO: integrate it in YACReader
TODO: add icons for groups
TODO: add conflicts detection
TODO: fix any shortcut used in keyPressEvent
TODO: choose new default shortcuts (F5 update, F11 fullscreen, etc...)
This commit is contained in:
Luis Ángel San Martín
2014-07-17 22:30:03 +02:00
parent 3c18599496
commit 50c8eca7c4
19 changed files with 933 additions and 78 deletions

View File

@ -0,0 +1,38 @@
#ifndef ACTIONS_SHORTCUTS_MODEL_H
#define ACTIONS_SHORTCUTS_MODEL_H
#include <QAbstractItemModel>
class QAction;
class ActionsShortcutsModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit ActionsShortcutsModel(QObject *parent = 0);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
QModelIndex parent(const QModelIndex &index) const;
void addActions(const QList<QAction *> actions);
Qt::ItemFlags flags(const QModelIndex &index) const;
enum Columns {
ICON = 0,
NAME,
KEYS
};
signals:
public slots:
protected:
QList<QAction *> actions;
};
#endif // ACTIONS_SHORTCUTS_MODEL_H