-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
123 lines (77 loc) · 2.38 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "publicInclude.h"
#include "Q_person.h"
#include "udpListening.h"
#include "tcpFileSender.h"
#include <QDir>
#include <thread>
#include <QStandardItemModel>
#include "tcpReceiver.h"
#include "InfoDialog.h"
#include "setting.h"
#include "paintWidget.h"
#include "frinds.h"
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
Q_OBJECT
Q_CLASSINFO("version", "12");
Q_PROPERTY(QList<QHostAddress> allIp MEMBER all_ip);
public:
MainWindow(QWidget *parent = nullptr);
void mousePressEvent(QMouseEvent *event) override;
QList<QHostAddress> all_ip;
QList<QHostAddress> all_user;
QList<QStringList> messages;
QList<QPushButton *> buttons;
QMap<QString, QString> ip_name_map;
QMap<QString, QString> options;
int who = 0;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
void setAllIp(QList<QHostAddress> allIp);
void sent2All();
udpListening *tcp;
tcpSock *sock;
tcpReceiver *receiver;
QList<QHostAddress> getAllip();
~MainWindow();
public slots:
void persent_change(qint32 pers);
void port_change(qint32 port);
void open_self_info(bool a);
void openSetting(bool a);
void btn_clicked();
void deal_change();
void recv_icon(QString fileName, QHostAddress add, qint64 size, QString dir);
void sendSelfInfo(QHostAddress add, quint16 a);
void regist_one(QHostAddress add);
void usr_ben_clicked();
void add_message(const QString &message, const QHostAddress &add);
void test_alive();
void setFrindIcon(QString file, QHostAddress add);
void remove_one(QHostAddress add);
void send_file();
void send_dir();
void recv_file(QString fileName, QHostAddress add, qint64 size, QString dir);
void add_nameAndip(QString name, QHostAddress add);
void creatDir(QString path);
void nextFIle();
void handWrite_click();
void friend_click();
void load_selceIcon();
private:
QStringList file_list;
Ui::MainWindow *ui;
Q_person *person;
qint32 port;
QString file_path_tmp;
QVBoxLayout *frindBoxLayout;
QVBoxLayout *persentBarLayout;
void sendF(QString filename, QString path = "", QString type = "FD");
void dirExit(QString path);
void upGradeuserIfo();
void loadIcon();
};
#endif // MAINWINDOW_H