-
Notifications
You must be signed in to change notification settings - Fork 14
/
main.cpp
31 lines (24 loc) · 867 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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDebug>
#include <QScreen>
#include <QtQml>
#include "utility.h"
#include "video.h"
#define RegisterPlugin(Plugin) \
qmlRegisterType<Plugin>("com.star.intelligenthome", 1, 0, #Plugin)
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false);
app.setApplicationName("IntelligentHome");
app.setOrganizationName("Star");
app.setApplicationVersion("1.0.0");
RegisterPlugin(CameraVideo);
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("utility", Utility::getInstance());
engine.rootContext()->setContextProperty("screen", app.primaryScreen());
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
return app.exec();
}