This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
dasschmalter/DasSchmalterApp/Qt-Code/main.cpp

40 lines
928 B
C++
Raw Normal View History

2019-03-07 22:13:23 +01:00
#include <QQuickStyle>
#include <QStandardPaths>
#include <QtNetwork>
#include <QQmlApplicationEngine>
#include <QFile>
#include <QDesktopServices>
#include <QtCore/QUrl>
#include <QtCore/QCommandLineOption>
#include <QtCore/QCommandLineParser>
2019-02-23 10:33:02 +01:00
#include <QGuiApplication>
2019-03-07 22:13:23 +01:00
#include <QStyleHints>
#include <QScreen>
2019-02-23 10:33:02 +01:00
#include <QQmlApplicationEngine>
2019-02-23 21:49:41 +01:00
#include <QtQml/QQmlContext>
#include "appsettings.h"
2019-02-23 10:33:02 +01:00
int main(int argc, char *argv[])
{
2019-02-23 21:49:41 +01:00
AppSettings * pAppSettings = new AppSettings();
2019-02-23 10:33:02 +01:00
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
2019-02-23 21:49:41 +01:00
QQuickStyle::setStyle("Material");
2019-02-23 10:33:02 +01:00
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
2019-02-23 21:49:41 +01:00
QQmlContext *context = engine.rootContext();
context->setContextProperty("_cppAppSettings", pAppSettings);
2019-02-23 10:33:02 +01:00
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}