#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "headers/serverconn.h" #include "headers/appsettings.h" #include "headers/foodplanmodel.h" #include "headers/eventmodel.h" int main(int argc, char *argv[]) { AppSettings * pAppSettings = new AppSettings(); pGlobalAppSettings = pAppSettings; ServerConn * pServerConn = new ServerConn(); //pGlobalServConn = pServerConn; QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); qmlRegisterType("Backend", 1, 0, "FoodPlanModel"); qmlRegisterType("Backend", 1, 0, "EventModel"); 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); }