mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-28 22:44:32 +00:00
40 lines
920 B
C++
Executable File
40 lines
920 B
C++
Executable File
#include <QGuiApplication>
|
|
#include <QQmlApplicationEngine>
|
|
#include <QQmlContext>
|
|
#include <QIcon>
|
|
|
|
#include "CPP/cppmanager.h"
|
|
#include "CPP/mainmanager.h"
|
|
#include "CPP/outputmanager.h"
|
|
#include "CPP/pluginmanager.h"
|
|
#include "CPP/qmlmanager.h"
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QGuiApplication app(argc, argv);
|
|
|
|
app.setWindowIcon(QIcon("://icon"));
|
|
|
|
CppManager C;
|
|
QmlManager Q;
|
|
PluginManager P;
|
|
OutputManager O;
|
|
|
|
MainManager M(&C, &Q, &O, &P);
|
|
|
|
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);
|
|
|
|
|
|
engine.load(QUrl(QLatin1String("qrc:/QML/main.qml")));
|
|
if (engine.rootObjects().isEmpty()) return -1;
|
|
|
|
return app.exec();
|
|
}
|