-
Notifications
You must be signed in to change notification settings - Fork 0
/
alarmwidget.h
53 lines (39 loc) · 1.03 KB
/
alarmwidget.h
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
#ifndef ALARMWIDGET_H
#define ALARMWIDGET_H
#include <QWidget>
#include <QJsonObject>
#include <QNetworkAccessManager>
#include <thread>
QT_BEGIN_NAMESPACE
namespace Ui { class AlarmWidget; }
QT_END_NAMESPACE
class QLabel;
class AlarmWidget : public QWidget
{
Q_OBJECT
public:
AlarmWidget(QWidget *parent = nullptr);
~AlarmWidget();
protected:
void updateActiveEvents();
void handleNewEvent(const QJsonObject &obj);
void handleEventFinish(const QJsonObject &obj);
signals:
void newPostData(const QString &data);
protected slots:
void postRecved(const QString &data);
private slots:
void on_listEvents_currentRowChanged(int currentRow);
void on_comboCameras_currentIndexChanged(int index);
void on_pushSubscribe_clicked();
void on_tabWidget_currentChanged(int index);
protected:
void clearAlarm();
private:
Ui::AlarmWidget *ui;
std::thread listenThread;
QList<QLabel *> alarmLabels;
QNetworkAccessManager nm;
std::unordered_map<QString, std::unordered_map<QString, QJsonObject>> trackingObjects;
};
#endif // ALARMWIDGET_H