-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.hpp
44 lines (39 loc) · 984 Bytes
/
mainwindow.hpp
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
#pragma once
#include <QMainWindow>
#include <QSettings>
class QHostAddress;
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class UDPListener;
class KeySender;
class SetKeyDialog;
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void onBindClicked();
void onClearClicked();
void onKeySet(QStringList iStringList);
// void getKeyStroke(const QString &iRcvKeyName, QString &ioKeyToSend);
void onKeyReceived(const QString &iKey);
private:
Ui::MainWindow *ui;
UDPListener *_udpListener;
KeySender *_keySender;
quint16 _port = 3000;
bool _isBinded = false;
QMap<QString, QHostAddress> _ifacesMap;
QString _settingsFile;
SetKeyDialog *_setDialog = nullptr;
QSettings *_settings;
QMap<QString, QString> _mappedKeys;
void initInterfaces();
void loadSettings();
void initMap();
void checkPort();
};