mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 01:24:46 -07:00
Configurable shortcuts
This commit is contained in:
parent
b0bf94e378
commit
beaa4e9383
17 changed files with 1075 additions and 409 deletions
40
cockatrice/src/sequenceEdit/secuenceedit.h
Normal file
40
cockatrice/src/sequenceEdit/secuenceedit.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef SECUENCEEDIT_H
|
||||
#define SECUENCEEDIT_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QKeySequence>
|
||||
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QEvent;
|
||||
|
||||
class SecuenceEdit : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SecuenceEdit(QString shorcutName, QWidget *parent = 0);
|
||||
QString getSecuence();
|
||||
signals:
|
||||
|
||||
private slots:
|
||||
void removeLastShortcut();
|
||||
void restoreDefault();
|
||||
protected:
|
||||
bool eventFilter(QObject *, QEvent *event);
|
||||
private:
|
||||
QString shorcutName;
|
||||
QLineEdit *lineEdit;
|
||||
QPushButton *clearButton;
|
||||
QPushButton *defaultButton;
|
||||
int keys;
|
||||
int currentKey;
|
||||
int maxKeys;
|
||||
bool valid;
|
||||
|
||||
void processKey(QKeyEvent *e);
|
||||
int translateModifiers(Qt::KeyboardModifiers state, const QString &text);
|
||||
void finishShortcut();
|
||||
void updateSettings();
|
||||
};
|
||||
|
||||
#endif // SECUENCEEDIT_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue