Qt: Remember window position

This commit is contained in:
Jeffrey Pfau 2015-03-28 23:14:10 -07:00
parent e93240f90c
commit 3fe32281c9
2 changed files with 7 additions and 0 deletions

View File

@ -84,6 +84,7 @@ Misc:
- GBA Thread: Make GBASyncWaitFrameStart time out
- GBA: Move A/V stream interface into core
- GBA: Savestates now take into account savedata state machines (fixes #109)
- Qt: Remember window position
0.1.1: (2015-01-24)
Bugfixes:

View File

@ -79,6 +79,11 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent)
m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height());
setCentralWidget(m_screenWidget);
QVariant windowPos = m_config->getQtOption("windowPos");
if (!windowPos.isNull()) {
move(windowPos.toPoint());
}
connect(m_controller, SIGNAL(gameStarted(GBAThread*)), this, SLOT(gameStarted(GBAThread*)));
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), m_display, SLOT(stopDrawing()));
connect(m_controller, SIGNAL(gameStopped(GBAThread*)), this, SLOT(gameStopped()));
@ -344,6 +349,7 @@ void Window::resizeEvent(QResizeEvent*) {
void Window::closeEvent(QCloseEvent* event) {
emit shutdown();
m_config->setQtOption("windowPos", pos());
QMainWindow::closeEvent(event);
}