Skip to content

Commit a909fa9

Browse files
committed
Change version to v2_0; Adjust form size based on first screen
1 parent 3aaa69f commit a909fa9

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/app/app.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ QT += core gui widgets printsupport
66

77
greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
88

9-
TARGET = MieSimulatorGUI_v1_4
9+
TARGET = MieSimulatorGUI_v2_0
1010
CONFIG -= -qt-freetype
1111
TEMPLATE = app
1212
DEFINES += QT_DEPRECATED_WARNINGS

src/app/main.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,27 @@
4343
#include "dialog/mainwindow.h"
4444
#include <QApplication>
4545
#include <QtPlugin>
46+
#include <QScreen>
4647

4748
int 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();

0 commit comments

Comments
 (0)