all repos — mgba @ 2f2e5398719f9d6a78ae84fc241945b46839b01c

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 "GamepadAxisEvent.h"
10
11#include <QWidget>
12
13#include "ui_ShortcutView.h"
14
15namespace QGBA {
16
17class ShortcutController;
18
19class ShortcutView : public QWidget {
20Q_OBJECT
21
22public:
23	ShortcutView(QWidget* parent = nullptr);
24
25	void setController(ShortcutController* controller);
26
27protected:
28	virtual bool eventFilter(QObject* obj, QEvent* event) override;
29
30private slots:
31	void load(const QModelIndex&);
32	void clear();
33	void updateKey(const QKeySequence&);
34	void updateButton(int button);
35	void updateAxis(int axis, int direction);
36
37private:
38	Ui::ShortcutView m_ui;
39
40	ShortcutController* m_controller;
41};
42
43}
44
45#endif