src/platform/qt/KeyEditor.h (view raw)
1#ifndef QGBA_KEY_EDITOR
2#define QGBA_KEY_EDITOR
3
4#include <QLineEdit>
5
6namespace QGBA {
7
8class KeyEditor : public QLineEdit {
9Q_OBJECT
10
11public:
12 KeyEditor(QWidget* parent = nullptr);
13
14 void setValue(int key);
15 int value() const { return m_key; }
16
17 virtual QSize sizeHint() const override;
18
19signals:
20 void valueChanged(int key);
21
22protected:
23 virtual void keyPressEvent(QKeyEvent* event) override;
24
25private:
26 int m_key;
27};
28
29}
30
31#endif