forked from CPP-Final-Project/Chat_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChatWView.h
43 lines (33 loc) · 1 KB
/
ChatWView.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
#pragma once
#include <QListView>
#include <QTimer>
#include <QMenu>
#include <QMessageBox>
#include <QMouseEvent>
#include "Styles.h"
#include "ChatWModel.h"
#include "ChatWDelegate.h"
class ChatWView : public QListView
{
Q_OBJECT;
public:
explicit ChatWView(QWidget* parent);
~ChatWView() override;
ChatWView(const ChatWView&) = delete;
ChatWView(ChatWView&&) = delete;
const ChatWView& operator =(const ChatWView&) = delete;
ChatWView& operator = (ChatWView&&) = delete;
public Q_SLOTS:
void onChatAdded(const QVariant& new_msg) const;
void onChatsAdded(const QVariantList& msg_list_) const;
void onCustomContextMenuRequested(const QPoint& pos);
void onRowsInserted(const QModelIndex& parent, int first, int last);
Q_SIGNALS:
void chatClicked(qint32 chat_id_, const QString& chat_name_);
protected:
void mouseMoveEvent(QMouseEvent* event) override;
void mouseDoubleClickEvent(QMouseEvent* event) override;
//void mouseReleaseEvent(QMouseEvent* event) override;
private:
QModelIndex _last_index{};
};