-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
49 lines (42 loc) · 1.8 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
#include "appdelegate.h"
#include "audio/audiomanager.h"
#include "lps/qenvironement.h"
#include "sm_config.h"
#include "ui/abstractmodel/abstractmodelmanager.h"
#include "ui/chart/chartmanager.h"
#include "ui/thememanager.h"
#include "sm_config.h"
#include <QApplication>
#include <QQmlApplicationEngine>
int main(int argc, char* argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
// Singletone Elements
qmlRegisterSingletonType<AppDelegate>(
SM_PACKAGE_NAME, SM_PACKAGE_VERSION_MAJOR, SM_PACKAGE_VERSION_MINOR,
"AppDelegate", &AppDelegate::qmlSingleton);
qmlRegisterSingletonType<ThemeManager>(
SM_PACKAGE_NAME, SM_PACKAGE_VERSION_MAJOR, SM_PACKAGE_VERSION_MINOR,
"ThemeManager", &ThemeManager::qmlSingleton);
qmlRegisterSingletonType<AbstractModelManager>(
SM_PACKAGE_NAME, SM_PACKAGE_VERSION_MAJOR, SM_PACKAGE_VERSION_MINOR,
"AbstractModelManager", &AbstractModelManager::qmlSingleton);
qmlRegisterSingletonType<ChartManager>(
SM_PACKAGE_NAME, SM_PACKAGE_VERSION_MAJOR, SM_PACKAGE_VERSION_MINOR,
"ChartManager", &ChartManager::qmlSingleton);
qmlRegisterSingletonType<AudioManager>(
SM_PACKAGE_NAME, SM_PACKAGE_VERSION_MAJOR, SM_PACKAGE_VERSION_MINOR,
"AudioManager", &AudioManager::qmlSingleton);
qmlRegisterSingletonType<QEnvironement>(
SM_PACKAGE_NAME, SM_PACKAGE_VERSION_MAJOR, SM_PACKAGE_VERSION_MINOR,
"QEnvironement", &QEnvironement::qmlSingleton);
AppDelegate* appdelegate = sm::single_tone<AppDelegate>();
appdelegate->initUi();
appdelegate->initAudioSystem();
QQmlApplicationEngine engine;
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}