-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
47 lines (35 loc) · 1.26 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
#include <QtCore>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickView>
#include <QQuickStyle>
#include "cameradiscovery.h"
#include "cameradevice.h"
#ifdef Q_OS_WIN32
#include <windows.h>
#endif
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QCoreApplication::setOrganizationDomain("org.tal.cutepocketcamera");
QCoreApplication::setOrganizationName("tal.org");
QCoreApplication::setApplicationName("CutePocketCamera");
QCoreApplication::setApplicationVersion("0.1");
#ifdef DEBUG
QLoggingCategory::setFilterRules(QStringLiteral("qt.bluetooth* = true"));
#endif
qmlRegisterType<CameraDevice>("org.tal", 1,0, "CameraDevice");
qmlRegisterType<CameraDiscovery>("org.tal", 1,0, "CameraDiscovery");
qRegisterMetaType<QBluetoothDeviceInfo *>("BluetoothDeviceInfo");
QQuickStyle::setStyle("Universal");
QQmlApplicationEngine engine;
QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
&app, []() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("CutePocketRemote", "Main");
#ifdef Q_OS_WIN32
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
#endif
return app.exec();
}