summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.cc8
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();