1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc
index 9ef7ffd7..d7cb88b3 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -16,6 +16,7 @@
*/
#include <QApplication>
+#include <QDesktopWidget>
#include <QFontDatabase>
#include "MainWindow.h"
@@ -42,6 +43,13 @@ int main(int argc, char *argv[])
app.setFont(font);
MainWindow w;
+
+ // Move the MainWindow to the center
+ QRect screenGeometry = QApplication::desktop()->screenGeometry();
+ int x = (screenGeometry.width() - w.width()) / 2;
+ int y = (screenGeometry.height() - w.height()) / 2;
+
+ w.move(x, y);
w.show();
return app.exec();
|