all repos — mgba @ ec5445d5ada31006cf154f5cba767b4239b7ffd3

mGBA Game Boy Advance Emulator

src/platform/qt/ShortcutView.h (view raw)

 1/* Copyright (c) 2013-2015 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_SHORTCUT_VIEW
 7#define QGBA_SHORTCUT_VIEW
 8
 9#include <QWidget>
10
11#include "ui_ShortcutView.h"
12
13namespace QGBA {
14
15class InputController;
16class ShortcutController;
17
18class ShortcutView : public QWidget {
19Q_OBJECT
20
21public:
22	ShortcutView(QWidget* parent = nullptr);
23
24	void setController(ShortcutController* controller);
25	void setInputController(InputController* controller);
26
27protected:
28	virtual bool event(QEvent* event) override;
29	virtual bool eventFilter(QObject* obj, QEvent* event) override;
30
31private slots:
32	void load(const QModelIndex&);
33	void clear();
34	void updateKey(const QKeySequence&);
35	void updateButton(int button);
36
37private:
38	Ui::ShortcutView m_ui;
39
40	ShortcutController* m_controller;
41	InputController* m_inputController;
42};
43
44}
45
46#endif