forked from kangear/NetAssistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
67 lines (59 loc) · 1.53 KB
/
mainwindow.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QUdpSocket>
#include <QLabel>
#include <QPushButton>
#include "udpclient.h"
#include "commonhelper.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_clearReceive_pushButton_released();
void on_clearSend_pushButton_released();
void on_connect_pushButton_released();
void on_handSend_pushButton_released();
void updateReceiveText(const QString string);
void on_clearCounter_pushButton_released();
void on_quit_pushButton_released();
void updateStateBar(QString state, QVariant inNum, QVariant outNum);
private:
Ui::MainWindow *ui;
QUdpSocket *udpSocket;
void connectNet();
void disConnectNet();
bool isConnect;
UDPClient client;
/** 工具类 */
CommonHelper chelper;
/** 状态标签 */
QLabel *statusLabel;
/** 总接收数量显示标签 */
QLabel *receiveLabel;
/** 总发送数量显示标签 */
QLabel *sendLabel;
/** 状态栏 计数清零 按钮 */
QPushButton *clearCounterButton;
/** 状态栏 时间标签 */
QLabel *timeLabel;
/** 接收总数 */
quint64 mReceiveNum;
/** 发送总数 */
quint64 mSendNum;
/** 远程IP */
QString mRemoteIp;
/** 远程端口 */
int mRemotePort;
/** 本地端口 */
int mLocalPort;
void doSettings(bool isWrite);
void init();
};
#endif // MAINWINDOW_H