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/main.cpp

29 lines
663 B
C++
Raw Normal View History

2019-02-23 10:33:02 +01:00
#include <QGuiApplication>
#include <QQmlApplicationEngine>
2019-02-23 21:49:41 +01:00
#include <QtQml/QQmlContext>
#include <QQuickStyle>
#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();
}