Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
63 lines (50 loc) · 1.86 KB
/
Copy pathmain.cpp
File metadata and controls
63 lines (50 loc) · 1.86 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "aui.h"
#include "auipageorientation.h"
#include "auipagestatus.h"
#include "landedtheme.h"
#include "jsonstorage.h"
#include "torchhelper.h"
#include "satinfosource.h"
#include "smshelper.h"
#include "contactshelper.h"
static QObject *aui_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
AUI *aui = new AUI();
return aui;
}
static QObject *theme_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
LandedTheme *landedTheme = new LandedTheme();
return landedTheme;
}
static QObject *jsonStorage_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
Q_UNUSED(scriptEngine)
JSONStorage *jsonStorage = new JSONStorage();
return jsonStorage;
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QCoreApplication::setOrganizationDomain("org.flyingsheep.landed");
qmlRegisterUncreatableType<AUIPageOrientation>("AUI", 1, 0, "AUIPageOrientation", "");
qmlRegisterUncreatableType<AUIPageStatus>("AUI", 1, 0, "AUIPageStatus", "");
qmlRegisterSingletonType<AUI>("AUI", 1, 0, "AUI", aui_singletontype_provider);
qmlRegisterSingletonType<LandedTheme>("LandedTheme", 1, 0, "LandedTheme", theme_singletontype_provider);
qmlRegisterSingletonType<JSONStorage>("JSONStorage",1,0,"JSONStorage", jsonStorage_singletontype_provider);
qmlRegisterType<SatInfoSource>("SatInfoSource",1,0,"SatInfoSource");
qmlRegisterType<SmsHelper>("SmsHelper",1,0,"SmsHelper");
ContactsHelper::registerTypes();
qmlRegisterType<TorchHelper>("TorchHelper",1,0,"TorchHelper");
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
return app.exec();
}