File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ QT += core gui widgets printsupport
66
77greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
88
9- TARGET = MieSimulatorGUI_v1_4
9+ TARGET = MieSimulatorGUI_v2_0
1010CONFIG -= -qt -freetype
1111TEMPLATE = app
1212DEFINES += QT_DEPRECATED_WARNINGS
Original file line number Diff line number Diff line change 4343#include " dialog/mainwindow.h"
4444#include < QApplication>
4545#include < QtPlugin>
46+ #include < QScreen>
4647
4748int main (int argc, char *argv[])
4849{
4950 QApplication a (argc, argv);
5051
52+ // Use this for cross-platform font consistency
5153 QFont defaultFont;
5254 defaultFont.setPointSize (9 );
53-
54- #if defined(Q_OS_WIN) || defined(Q_OS_LINUX)
5555 defaultFont.setFamily (" Arial" );
5656 a.setStyleSheet (" QWidget { font-size: 11px; }" );
57- #elif defined(Q_OS_MACOS)
58- defaultFont.setFamily (" Helvetica" );
59- a.setStyleSheet (" QWidget { font-size: 10px; }" );
60- #endif
61-
62- // Set default font
6357 a.setFont (defaultFont);
6458
6559 MainWindow w;
60+ QList<QScreen *> screens = QGuiApplication::screens ();
61+ if (!screens.isEmpty ()) {
62+ QScreen *screen = screens.first ();
63+ QSize screenSize = screen->size ();
64+ w.resize (screenSize.width () / 2 , screenSize.height () / 2 );
65+ }
66+
6667 w.show ();
6768 return a.exec ();
6869 a.quit ();
You can’t perform that action at this time.
0 commit comments