-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
26 lines (21 loc) · 871 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include "networkmanager.h"
#include "cpputils.h"
#include "cachingnetworkmanagerfactory.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
app.setOrganizationName("AMeditation");
app.setOrganizationDomain("antonovpsy.ru");
QQmlApplicationEngine engine;
engine.setNetworkAccessManagerFactory(new CachingNetworkManagerFactory());
qmlRegisterSingletonType<CppUtils>("AMeditation.CppUtils", 1, 0, "CppUtils", CppUtils::cppUtilsSingletoneProvider);
engine.rootContext()->setContextProperty("networkManager", new NetworkManager());
engine.load(QUrl(QLatin1String("qrc:/qml/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}