Center the window on the screen.

master
Simon Quigley 6 years ago
parent 3d1a75b901
commit 348df0114a

@ -15,11 +15,22 @@
#include "mainwindow.h"
#include <QApplication>
#include <QStyle>
#include <QDesktopWidget>
#include <QScreen>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWindow w;
w.setGeometry(
QStyle::alignedRect(
Qt::LeftToRight,
Qt::AlignCenter,
w.size(),
QGuiApplication::screens().first()->geometry()
)
);
w.show();
return app.exec();

Loading…
Cancel
Save