QtDeployer/source/main.cpp

40 lines
914 B
C++
Raw Normal View History

2018-03-12 11:43:03 +03:30
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
2018-05-07 19:33:05 +03:00
#include "CPP/cppmanager.h"
#include "CPP/mainmanager.h"
#include "CPP/outputmanager.h"
#include "CPP/pluginmanager.h"
#include "CPP/qmlmanager.h"
#include "CPP/snapmanager.h"
2018-03-12 11:43:03 +03:30
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
CppManager C;
QmlManager Q;
PluginManager P;
OutputManager O;
2018-05-07 19:33:05 +03:00
SnapManager S;
MainManager M(&C, &Q, &O, &P, &S);
2018-03-12 11:43:03 +03:30
QQmlApplicationEngine engine;
auto *R = engine.rootContext();
R->setContextProperty("CppManager", &C);
R->setContextProperty("QmlManager", &Q);
R->setContextProperty("PluginManager", &P);
R->setContextProperty("MainManager", &M);
R->setContextProperty("OutputManager", &O);
2018-05-07 19:33:05 +03:00
R->setContextProperty("SnapManager", &S);
2018-03-12 11:43:03 +03:30
engine.load(QUrl(QLatin1String("qrc:/QML/main.qml")));
if (engine.rootObjects().isEmpty()) return -1;
return app.exec();
}