From b014ecc335c83968a388a6850475c58ea10d5dae Mon Sep 17 00:00:00 2001 From: TotalCaesar659 <14265316+TotalCaesar659@users.noreply.github.com> Date: Tue, 8 Oct 2019 04:53:06 +0300 Subject: [PATCH] Move window to center --- Qt/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 30949eb493..502e22a0fd 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -25,9 +25,9 @@ MainWindow::MainWindow(QWidget *parent, bool fullscreen) : QDesktopWidget *desktop = QApplication::desktop(); int screenNum = QProcessEnvironment::systemEnvironment().value("SDL_VIDEO_FULLSCREEN_HEAD", "0").toInt(); - // Move window to top left coordinate of selected screen + // Move window to the center of selected screen QRect rect = desktop->screenGeometry(screenNum); - move(rect.topLeft()); + move((rect.width()-frameGeometry().width()) / 4, (rect.height()-frameGeometry().height()) / 4); SetGameTitle(""); emugl = new MainUI(this);