-
Notifications
You must be signed in to change notification settings - Fork 0
/
QtQQ_Server.h
52 lines (47 loc) · 1.25 KB
/
QtQQ_Server.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
#pragma once
#include <QtWidgets/QDialog>
#include "ui_QtQQ_Server.h"
#include"TcpServer.h"
#include"DBconn.h"
#include<QMessageBox>
#include<QHeaderView>
#include<QTableWidgetItem>
#include<QTimer>
#include<QFileDialog>
#include<QUdpSocket>
#include<QNetworkDatagram>
class QtQQ_Server : public QDialog
{
Q_OBJECT
public:
QtQQ_Server(QWidget *parent = nullptr);
~QtQQ_Server();
private:
void initComboxBoxData();//初始化组合款的数据
void setMap();
void initTcpSocket();
void initUdpSocket();
bool connectMySql();
int getCompDepId();
void updateTableData(int depID = 0, int employeeID = 0);
private slots:
void onUDPbroadMsg(QByteArray&btData);
void onRefresh();
void on_queryDepartmentBtn_clicked();//点击信号与槽函数自动连接
void on_queryIDBtn_clicked();
void on_logoutBtn_clicked();
void on_selectPictureBtn_clicked();
void on_addBtn_clicked();
private:
Ui::QtQQ_ServerClass ui;
QTimer* m_timer;
TcpServer* m_tcpServer;//tcp服务端
QUdpSocket* m_udpSender;//udp广播
int m_compDepId;
int m_depID;//部门id
int m_employeeID;//员工id
QString m_pixPath;
QMap<QString, QString>m_statuMap;
QMap<QString, QString>m_depNameMap;
QMap<QString, QString>m_onlineMap;
};