-
Notifications
You must be signed in to change notification settings - Fork 0
/
chatwindow.h
57 lines (52 loc) · 1.46 KB
/
chatwindow.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
#ifndef CHATWINDOW_H
#define CHATWINDOW_H
#include <QMainWindow>
#include <QVector>
#include <QListView>
#include <friendcard.h>
#include <QListWidget>
#include <QStandardItemModel>
#include <QTcpSocket>
#include <QPropertyAnimation>
#include <creategroup.h>
#include "msgbubble.h"
#include "loginhint.h"
namespace Ui {
class ChatWindow;
}
class ChatWindow : public QMainWindow
{
Q_OBJECT
public:
explicit ChatWindow(const QVector<QString>& friends,
const QString& acc_name,
QTcpSocket* client,
const QString& style_sheet,
QWidget *parent = nullptr
);
~ChatWindow();
void addFriend(const QString& friend_acc);
void recieve(const QString& who, const QString& what);
Ui::ChatWindow* get_ui();
private:
Ui::ChatWindow *ui;
QListWidget* friends_list;
QTcpSocket* client;
QString acc_name;
QString target_name;
QListWidget* current_chat;
QHash<QString, QListWidget*>* list_map;
QPoint z;
QPropertyAnimation* animation_close;
QPropertyAnimation* animation_minimize;
CreateGroup* create_group;
QSet<QString>* group_set;
private slots:
void send_msg();
protected:
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void keyPressEvent(QKeyEvent* event) override;
};
#endif // CHATWINDOW_H