all repos — mgba @ 8a82144ceb56398f2827c6abf8668972fb9caefb

mGBA Game Boy Advance Emulator

src/platform/qt/Window.cpp (view raw)

 1#include "Window.h"
 2
 3#include <QFileDialog>
 4
 5using namespace QGBA;
 6
 7Window::Window(QWidget* parent) : QMainWindow(parent) {
 8	setupUi(this);
 9
10	m_controller = new GameController(this);
11	m_display = new Display(this);
12	setCentralWidget(m_display);
13	connect(m_controller, SIGNAL(frameAvailable(const QImage&)), m_display, SLOT(draw(const QImage&)));
14
15	connect(actionOpen, SIGNAL(triggered()), this, SLOT(selectROM()));
16}
17
18void Window::selectROM() {
19	QString filename = QFileDialog::getOpenFileName(this, tr("Select ROM"));
20	if (!filename.isEmpty()) {
21		m_controller->loadGame(filename);
22	}
23}