mirror of
https://gitee.com/Zhaoxin59/my-chat_-client.git
synced 2026-02-14 00:51:48 +08:00
57 lines
1023 B
C++
57 lines
1023 B
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
|
|
#include "data.h"
|
|
|
|
namespace model
|
|
{
|
|
|
|
class DataCenter : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static DataCenter* getInstance();
|
|
|
|
/// <summary>
|
|
/// 计算两个整数的和。
|
|
/// </summary>
|
|
/// <param name="a">第一个加数</param>
|
|
/// <param name="b">第二个加数</param>
|
|
/// <returns>返回 a + b 的结果</returns>
|
|
/*int add(int a, int b) {
|
|
return a + b;
|
|
}*/
|
|
|
|
private:
|
|
DataCenter();
|
|
|
|
static DataCenter* instance;
|
|
|
|
//列出DataCenter中要组织管理的所有数据
|
|
|
|
//当前客户端登录到服务器对应的登录会话Id
|
|
QString loginSessionId;
|
|
|
|
//当前的用户信息
|
|
UserInfo* myself = nullptr;
|
|
|
|
//好友列表
|
|
QList<UserInfo>* firendList = nullptr;
|
|
|
|
//会话列表
|
|
QList<ChatSessionInfo>* chatSessionList = nullptr;
|
|
|
|
//记录当前选中的会话是哪个
|
|
QString currentChatSession = "";
|
|
|
|
//记录每个会话中,都有哪些成员
|
|
QHash<QString, QList<UserInfo>>* memberList = nullptr;//unordered_map
|
|
|
|
//待处理的好友申请列表
|
|
QList<UserInfo>* applyList = nullptr;
|
|
|
|
signals:
|
|
};
|
|
} //end namespace model
|