-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
40 lines (29 loc) · 1005 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
27
28
29
30
31
32
33
34
35
36
37
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <src/services/appService.h>
#include <src/MainViewModel.h>
#include <src/constants.h>
#include <src/appUtils.h>
static QObject *appUtilsSingletonProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
AppUtils *appUtils = new AppUtils();
return appUtils;
}
int main(int argc, char *argv[])
{
#if defined(Q_OS_WIN)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
qmlRegisterType<MainViewModel>("feedbackapp.backend", 1, 0, "PageMainViewModel");
qmlRegisterSingletonType<AppUtils>("feedbackapp.static.utils", 1, 0, "AppUtils", appUtilsSingletonProvider);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
Services::AppService appSvc(Constants::FILE_CSV);
appSvc.init();
return app.exec();
}