-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
77 lines (66 loc) · 1.88 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QDebug>
#include <QMetaType>
#include <QHostAddress>
#include <QNetworkInterface>
#include "zmsqapplication.h"
#include "camvideoproducer.h"
#include "zmclient.h"
#include "monitor_model.h"
#include "zmdata.h"
#include "preferences.h"
#include "scenebuilder.h"
#include "networksmodel.h"
#include "zmsearch.h"
#include "tilemodel.h"
#include "platform.h"
#ifdef Q_OS_WIN
void customMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg) {
Q_UNUSED(context);
QString txt;
QByteArray localMsg = msg.toLocal8Bit();
switch (type)
{
case QtDebugMsg:
txt = QString("Debug: %1").arg(msg);
break;
case QtWarningMsg:
txt = QString("Warning: %1").arg(msg);
break;
case QtCriticalMsg:
txt = QString("Critical: %1").arg(msg);
break;
case QtFatalMsg:
txt = QString("Fatal: %1").arg(msg);
break;
default:
abort();
}
QFile outFile("debuglog.txt");
outFile.open(QIODevice::WriteOnly | QIODevice::Append);
QTextStream ts(&outFile);
ts << txt << endl;
}
#endif
int main(int argc, char *argv[]) {
#ifdef Q_OS_WIN
//qInstallMessageHandler(customMessageHandler);
#endif
qDebug() << "zmSquarer started";
CamVideoProducer::registerQmlType();
ZMClient::registerMetaType();
ZMClient::registerQmlType();
MonitorModel::registerQmlType();
Preferences::registerQmlType();
SceneBuilder::registerQmlType();
NetworksModel::registerQmlType();
ZMSearch::registerQmlType();
TileModel::registerQmlType();
Platform::registerQmlType();
ZMSQApplication app(argc, argv);
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:///qml/zmsq.qml")));
//engine.load(QUrl(QStringLiteral("qrc:///zmSquarer2.qml")));
return app.exec();
}