Qt: Remember window position
Jeffrey Pfau jeffrey@endrift.com
Sat, 28 Mar 2015 23:14:10 -0700
2 files changed,
7 insertions(+),
0 deletions(-)
M
CHANGES
→
CHANGES
@@ -84,6 +84,7 @@ - All: Enable link-time optimization
- 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:
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -79,6 +79,11 @@ m_screenWidget->setPixmap(m_logo);
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::closeEvent(QCloseEvent* event) { emit shutdown(); + m_config->setQtOption("windowPos", pos()); QMainWindow::closeEvent(event); }