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.
fanny-app/sources/main.cpp
dorian 99fd686c65 - New Design almost finished
- further implementation of in-app event display but stiff having problems
2018-12-23 00:06:05 +01:00

52 lines
1.3 KiB
C++

#include <QQuickStyle>
#include <QStandardPaths>
#include <QtNetwork>
#include <QQmlApplicationEngine>
#include <QFile>
#include <QDesktopServices>
#include <QtCore/QUrl>
#include <QtCore/QCommandLineOption>
#include <QtCore/QCommandLineParser>
#include <QGuiApplication>
#include <QStyleHints>
#include <QScreen>
#include <QQmlApplicationEngine>
#include <QtQml/QQmlContext>
#include <QtWebView/QtWebView>
#include "headers/serverconn.h"
#include "headers/appsettings.h"
int main(int argc, char *argv[])
{
ServerConn * pServerConn = new ServerConn;
AppSettings * pAppSettings = new AppSettings();
pGlobalAppSettings = pAppSettings;
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//! [0]
QGuiApplication app(argc, argv);
QtWebView::initialize();
//! [0]
QQuickStyle::setStyle("Material");
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
QQmlContext *context = engine.rootContext();
context->setContextProperty("_cppServerConn", pServerConn);
context->setContextProperty("_cppAppSettings", pAppSettings);
if (engine.rootObjects().isEmpty())
return -1;
int ret;
ret = app.exec();
delete pServerConn;
delete pAppSettings;
return(ret);
}