├── Client-EChat ├── EChat.ico ├── EChat.pro ├── EChat.pro.user ├── audio │ └── simpeCuteAlert.wav ├── db │ ├── database.cpp │ └── database.h ├── device │ ├── config.cpp │ ├── config.h │ ├── desktop.cpp │ ├── desktop.h │ ├── file.cpp │ ├── file.h │ ├── screenshot.cpp │ └── screenshot.h ├── emo │ ├── emoji.cpp │ ├── emoji.h │ └── emoji.ui ├── global.cpp ├── global.h ├── img │ ├── EChat.ico │ ├── EChat.png │ ├── account.png │ ├── addContanct-hover.png │ ├── addContanct-normal.png │ ├── arrow-left.png │ ├── arrow-right.png │ ├── comBoxFlod.png │ ├── contact-clicked.png │ ├── contact-hover.png │ ├── contact-normal.png │ ├── defaultPicture.ico │ ├── edit.png │ ├── emo-clicked.png │ ├── emo-normal.png │ ├── file.png │ ├── flod.png │ ├── folder-clicked.png │ ├── folder-hover.png │ ├── folder-normal.png │ ├── ghost.gif │ ├── head │ │ ├── 1.png │ │ ├── 10.png │ │ ├── 1001.png │ │ ├── 1002.png │ │ ├── 1003.png │ │ ├── 11.png │ │ ├── 12.png │ │ ├── 13.png │ │ ├── 14.png │ │ ├── 15.png │ │ ├── 16.png │ │ ├── 17.png │ │ ├── 18.png │ │ ├── 19.png │ │ ├── 2.png │ │ ├── 20.png │ │ ├── 21.png │ │ ├── 3.png │ │ ├── 4.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ ├── 9.png │ │ ├── group.png │ │ └── person.png │ ├── image-clicked.png │ ├── image-normal.png │ ├── lineLoading.gif │ ├── more-clicked.png │ ├── more-hover.png │ ├── more-normal.png │ ├── msg-clicked.png │ ├── msg-hover.png │ ├── msg-normal.png │ ├── password.png │ ├── pwdClose.png │ ├── pwdOpen.png │ ├── refresh.png │ ├── resetPwd.png │ ├── rocket.gif │ ├── screenshot-clicked.png │ ├── screenshot-normal.png │ ├── search.png │ ├── setting-clicked.png │ ├── setting-hover.png │ ├── setting-normal.png │ ├── skypeLoader.gif │ ├── sure.png │ ├── switchLeft.png │ ├── switchRight.png │ ├── testPicture.jpg │ └── threeLoading.gif ├── item │ ├── headpicture.cpp │ ├── headpicture.h │ ├── headpicture.ui │ ├── itemchatobject.cpp │ ├── itemchatobject.h │ ├── itemchatobject.ui │ ├── itemcontact.cpp │ ├── itemcontact.h │ ├── itemcontact.ui │ ├── itemfriendapply.cpp │ ├── itemfriendapply.h │ └── itemfriendapply.ui ├── main.cpp ├── network │ ├── client.cpp │ └── client.h ├── qss │ ├── chat.qss │ ├── home.qss │ ├── login.qss │ └── style.qss ├── res.qrc ├── thumbnail.h └── ui │ ├── uichat.cpp │ ├── uichat.h │ ├── uichat.ui │ ├── uihome.cpp │ ├── uihome.h │ ├── uihome.ui │ ├── uilogin.cpp │ ├── uilogin.h │ ├── uilogin.ui │ ├── uirely.cpp │ └── uirely.h ├── DB ├── 客户端SQLite(仅结构).sql └── 服务器MySQL(仅结构).sql ├── LICENSE ├── README.md ├── Server-EChat ├── .vscode │ ├── c_cpp_properties.json │ └── settings.json ├── CMakeLists.txt ├── build │ ├── CMakeCache.txt │ ├── CMakeFiles │ │ ├── 3.22.1 │ │ │ ├── CMakeCCompiler.cmake │ │ │ ├── CMakeCXXCompiler.cmake │ │ │ ├── CMakeDetermineCompilerABI_C.bin │ │ │ ├── CMakeDetermineCompilerABI_CXX.bin │ │ │ ├── CMakeSystem.cmake │ │ │ ├── CompilerIdC │ │ │ │ ├── CMakeCCompilerId.c │ │ │ │ └── a.out │ │ │ └── CompilerIdCXX │ │ │ │ ├── CMakeCXXCompilerId.cpp │ │ │ │ └── a.out │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── CMakeOutput.log │ │ ├── EChat.dir │ │ │ ├── DependInfo.cmake │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── compiler_depend.internal │ │ │ ├── compiler_depend.make │ │ │ ├── compiler_depend.ts │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ ├── main.cpp.o │ │ │ ├── main.cpp.o.d │ │ │ └── progress.make │ │ ├── Makefile.cmake │ │ ├── Makefile2 │ │ ├── TargetDirectories.txt │ │ ├── cmake.check_cache │ │ └── progress.marks │ ├── EChat │ ├── Makefile │ ├── cmake_install.cmake │ └── src │ │ ├── CMakeFiles │ │ ├── CMakeDirectoryInformation.cmake │ │ ├── echatlib.dir │ │ │ ├── DataBase.cpp.o │ │ │ ├── DataBase.cpp.o.d │ │ │ ├── DependInfo.cmake │ │ │ ├── FdTool.cpp.o │ │ │ ├── FdTool.cpp.o.d │ │ │ ├── Server.cpp.o │ │ │ ├── Server.cpp.o.d │ │ │ ├── build.make │ │ │ ├── cmake_clean.cmake │ │ │ ├── cmake_clean_target.cmake │ │ │ ├── compiler_depend.internal │ │ │ ├── compiler_depend.make │ │ │ ├── compiler_depend.ts │ │ │ ├── depend.make │ │ │ ├── flags.make │ │ │ ├── link.txt │ │ │ └── progress.make │ │ └── progress.marks │ │ ├── Makefile │ │ ├── cmake_install.cmake │ │ └── libechatlib.a ├── include │ ├── DataBase.h │ └── Server.h ├── json │ ├── allocator.h │ ├── assertions.h │ ├── config.h │ ├── forwards.h │ ├── json.h │ ├── json_features.h │ ├── reader.h │ ├── value.h │ ├── version.h │ └── writer.h ├── lib │ └── libjsoncpp.a ├── main.cpp ├── mysql-sql │ ├── readme.txt │ └── structure.sql ├── src │ ├── CMakeLists.txt │ ├── DataBase.cpp │ ├── FdTool.cpp │ └── Server.cpp ├── test │ └── client.c └── 编译问题.txt ├── 常见问题(必看).txt └── 部分截图 ├── md ├── 文件管理模块图.png ├── 消息收发功能模块图.png ├── 用户配置功能模块图(图中为已实现的).png ├── 登录注册模块处理流程图.png └── 联系人管理模块图.png ├── 个人和好友信息展示效果图.png ├── 创建群聊效果图.png ├── 发送图片效果图.png ├── 好友消息收发界面效果图.png ├── 好友申请列表效果图.png ├── 用户配置界面图.png └── 系统登录界面效果图.png /Client-EChat/EChat.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/EChat.ico -------------------------------------------------------------------------------- /Client-EChat/EChat.pro: -------------------------------------------------------------------------------- 1 | QT += core gui network sql multimedia 2 | 3 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 4 | 5 | CONFIG += c++17 6 | # resources_big 7 | 8 | # You can make your code fail to compile if it uses deprecated APIs. 9 | # In order to do so, uncomment the following line. 10 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 11 | 12 | RC_ICONS = EChat.ico 13 | 14 | SOURCES += \ 15 | db/database.cpp \ 16 | device/config.cpp \ 17 | device/file.cpp \ 18 | device/screenshot.cpp \ 19 | emo/emoji.cpp \ 20 | global.cpp \ 21 | item/headpicture.cpp \ 22 | item/itemcontact.cpp \ 23 | network/client.cpp \ 24 | device/desktop.cpp \ 25 | item/itemchatobject.cpp \ 26 | item/itemfriendapply.cpp \ 27 | main.cpp \ 28 | ui/uichat.cpp \ 29 | ui/uihome.cpp \ 30 | ui/uilogin.cpp \ 31 | ui/uirely.cpp 32 | 33 | HEADERS += \ 34 | db/database.h \ 35 | device/config.h \ 36 | device/file.h \ 37 | device/screenshot.h \ 38 | emo/emoji.h \ 39 | global.h \ 40 | item/headpicture.h \ 41 | item/itemcontact.h \ 42 | network/client.h \ 43 | device/desktop.h \ 44 | item/itemchatobject.h \ 45 | item/itemfriendapply.h \ 46 | thumbnail.h \ 47 | ui/uichat.h \ 48 | ui/uihome.h \ 49 | ui/uilogin.h \ 50 | ui/uirely.h 51 | 52 | FORMS += \ 53 | emo/emoji.ui \ 54 | item/headpicture.ui \ 55 | item/itemchatobject.ui \ 56 | item/itemcontact.ui \ 57 | item/itemfriendapply.ui \ 58 | ui/uichat.ui \ 59 | ui/uihome.ui \ 60 | ui/uilogin.ui 61 | 62 | 63 | # Default rules for deployment. 64 | qnx: target.path = /tmp/$${TARGET}/bin 65 | else: unix:!android: target.path = /opt/$${TARGET}/bin 66 | !isEmpty(target.path): INSTALLS += target 67 | 68 | RESOURCES += \ 69 | res.qrc \ 70 | -------------------------------------------------------------------------------- /Client-EChat/audio/simpeCuteAlert.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/audio/simpeCuteAlert.wav -------------------------------------------------------------------------------- /Client-EChat/db/database.cpp: -------------------------------------------------------------------------------- 1 | #include "database.h" 2 | 3 | QMutex DataBase::mutex; 4 | DataBase* DataBase::instance=nullptr; 5 | 6 | DataBase* DataBase::getInstance() 7 | { 8 | if (instance == nullptr) { 9 | QMutexLocker locker(&mutex); 10 | if (instance == nullptr) { 11 | instance = new DataBase; 12 | } 13 | } 14 | return instance; 15 | } 16 | 17 | bool DataBase::connectDB() 18 | { 19 | if(isConnecting) 20 | return isConnecting; 21 | db = QSqlDatabase::addDatabase("QSQLITE"); //添加 SQL LITE数据库驱动 22 | QString path = CHATMSG_PATH(selfId); 23 | db.setDatabaseName(path + "/ChatMsg.db"); //设置数据库名称 24 | if(db.open()){ 25 | isConnecting = true; 26 | 27 | QStringList tables = db.tables(QSql::Tables); 28 | if(!tables.contains("ec_messages")){ 29 | QSqlQuery query; 30 | QString table_msg = "CREATE TABLE ec_messages( " 31 | "id INTEGER PRIMARY KEY AUTOINCREMENT , " // --COMMENT '自增id' 32 | "sender int NOT NULL , " //--COMMENT '发送者id,外键' 33 | "senderPicture int DEFAULT NULL , " //--COMMENT '发送者id,外键' 34 | "frd_id int DEFAULT NULL , " //--COMMENT '接收者id,外键' 35 | "grp_id int DEFAULT NULL , " //--COMMENT '接收者id,外键' 36 | "type tinyint(4) NOT NULL , " //--COMMENT '0-好友 1-群聊' 37 | "message longtext DEFAULT NULL, " //--COMMENT '消息' 38 | "msg_type varchar(50) NOT NULL, " //--COMMENT '消息类型' 39 | "send_time timestamp NOT NULL DEFAULT CURRENT_timestamp , " //--COMMENT '发送时间' 40 | "file_name varchar(255) DEFAULT NULL , " //--COMMENT '文件名' 41 | "suffix varchar(20) DEFAULT NULL , " //--COMMENT '文件后缀' 42 | "file_path text DEFAULT NULL); " ; // --COMMENT '文件路径' 43 | query.exec(table_msg); 44 | } 45 | if(!tables.contains("ec_users")){ 46 | QSqlQuery query; 47 | QString table_usr = "CREATE TABLE ec_users(" 48 | "id INTEGER PRIMARY KEY AUTOINCREMENT, " 49 | "usr_id int NOT NULL, " 50 | "usr_type tinyint(4) NOT NULL, " //--COMMENT '0-好友 1-群聊', 51 | "usr_nickname int DEFAULT NULL, " 52 | "usr_picture int DEFAULT NULL); "; 53 | query.exec(table_usr); 54 | } 55 | qDebug()<<"数据库连接成功..."; 56 | return isConnecting; 57 | } 58 | qDebug()<<"数据库已是连接状态..."; 59 | return false; 60 | } 61 | 62 | void DataBase::disconnectDB() 63 | { 64 | if(isConnecting){ 65 | db.close(); 66 | qDebug()<<"数据库已断开..."; 67 | } 68 | } 69 | 70 | bool DataBase::addLocalMsg(const QString &msg, const int &sender, const int &senderPicture, 71 | const int &receiver, const int &groupId, const int &type, const QString &sendTime) 72 | { 73 | QString sql; 74 | QSqlQuery query; 75 | if(!type){ //好友 76 | sql = QString("INSERT INTO ec_messages(sender,senderPicture,frd_id,type,message,msg_type,send_time) " 77 | "VALUES(%1, %2, %3, %4,'%5','text','%6');" 78 | ).arg(QString::number(sender),QString::number(senderPicture), 79 | QString::number(receiver),QString::number(type), msg, sendTime); 80 | }else{ 81 | sql = QString("INSERT INTO ec_messages(sender,senderPicture,grp_id,type,message,msg_type,send_time) " 82 | "VALUES(%1, %2, %3, %4,'%5','text','%6');" 83 | ).arg(QString::number(sender),QString::number(senderPicture), 84 | QString::number(groupId),QString::number(type), msg, sendTime); 85 | } 86 | // qDebug()< 5 | #include 6 | #include 7 | #include //数据库 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "global.h" 16 | 17 | class DataBase : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | static DataBase* getInstance(); 22 | 23 | bool connectDB(); 24 | void disconnectDB(); 25 | 26 | bool addLocalMsg(const QString &msg, const int &sender, const int &senderPicture, 27 | const int &receiver, const int &groupId,const int &type,const QString &sendTime); 28 | bool addLocalFileMsg(); 29 | 30 | void addLocalUser(const int&type, const int&id, const QString&nickname, const int &picture); 31 | 32 | void updateUserInfo(const int&id,const int&type, const QString&nickname, const int &picture); 33 | 34 | signals: 35 | 36 | private: 37 | bool isConnecting; 38 | QSqlDatabase db;//数据库 39 | 40 | private: 41 | explicit DataBase(QObject *parent = nullptr); 42 | DataBase(const DataBase&) = delete; 43 | DataBase& operator=(const DataBase&) = delete; 44 | 45 | static QMutex mutex; 46 | static DataBase* instance; 47 | }; 48 | 49 | #endif // DATABASE_H 50 | -------------------------------------------------------------------------------- /Client-EChat/device/config.cpp: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | 3 | Config::Config(QObject *parent) 4 | : QObject{parent} 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /Client-EChat/device/config.h: -------------------------------------------------------------------------------- 1 | #ifndef CONFIG_H 2 | #define CONFIG_H 3 | 4 | #include 5 | 6 | class Config : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Config(QObject *parent = nullptr); 11 | 12 | signals: 13 | 14 | }; 15 | 16 | #endif // CONFIG_H 17 | -------------------------------------------------------------------------------- /Client-EChat/device/desktop.cpp: -------------------------------------------------------------------------------- 1 | #include "device/desktop.h" 2 | 3 | Desktop* Desktop::instance = nullptr; 4 | 5 | Desktop::Desktop() 6 | { 7 | // 多屏操作 8 | // screenList = QGuiApplication::screens(); 9 | // screenCounts = screenList.size(); 10 | // if (screenCounts > 1) { 11 | // for (int i = 0; i < screenCounts; ++i) { 12 | // // 13 | // } 14 | // } 15 | 16 | // 主屏幕操作 17 | pScreen = QGuiApplication::primaryScreen(); 18 | pAvailableRect = pScreen->availableGeometry(); 19 | pScreenRect = pScreen->geometry(); 20 | } 21 | 22 | Desktop::~Desktop() {} 23 | -------------------------------------------------------------------------------- /Client-EChat/device/desktop.h: -------------------------------------------------------------------------------- 1 | #ifndef DESKTOP_H 2 | #define DESKTOP_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class Desktop 10 | { 11 | public: 12 | static Desktop *getInstance() { return new Desktop; } 13 | 14 | QRect pAvailableRect; // 获取可用桌面大小 15 | QRect pScreenRect; // 获取主屏幕分辨率 16 | 17 | // int screenCounts; // 获取屏幕数量 18 | // QList screenList; // 多屏操作 19 | 20 | private: 21 | QScreen *pScreen; // 主屏幕 22 | 23 | private: 24 | static Desktop *instance; 25 | Desktop(); 26 | Desktop(const Desktop &) = delete; 27 | Desktop &operator=(const Desktop &) = delete; 28 | ~Desktop(); 29 | 30 | 31 | }; 32 | 33 | #endif // DESKTOP_H 34 | -------------------------------------------------------------------------------- /Client-EChat/device/file.h: -------------------------------------------------------------------------------- 1 | #ifndef FILE_H 2 | #define FILE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "db/database.h" 15 | 16 | 17 | class File : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | static File* getInstance(); 22 | 23 | void checkDataFolder(); 24 | void checkConfigFile(); 25 | 26 | void updateAutoLogin(const bool& state); 27 | void updateRemainPwd(const bool& state); 28 | void updateNewNotifyVoice(const bool& state); 29 | void updateGroupNotifyVoice(const bool& state); 30 | void updateAutoUpdate(const bool& state); 31 | void updateFilePath(const QString& filePath); 32 | 33 | void updateEchatId(const int& userId); 34 | void updatePassword(const QString& password); 35 | 36 | bool getAutoLogin(){ return AutoLogin; }; 37 | bool getRemainPwd(){ return RemainPwd; }; 38 | bool getNewNotifyVoice(){ return NewNotifyVoice; }; 39 | bool getGroupNotifyVoice(){ return GroupNotifyVoice; }; 40 | bool getAutoUpdate(){ return AutoUpdate; }; 41 | QString getFilePath(){ return FilePath; }; 42 | int getEchatId(){ return echatId; }; 43 | QString getPassword(){ return encryptPassword(password); }; 44 | 45 | private: 46 | QString encryptPassword(const QString& password); 47 | 48 | private: 49 | bool AutoLogin; 50 | bool RemainPwd; 51 | bool NewNotifyVoice; 52 | bool GroupNotifyVoice; 53 | bool AutoUpdate; 54 | QString FilePath; 55 | int echatId; //默认0 56 | QString password; //默认"" 57 | 58 | explicit File(QObject *parent = nullptr); 59 | File(const File&) = delete; 60 | File& operator=(const File&) = delete; 61 | 62 | static QMutex mutex; 63 | static File* instance; 64 | }; 65 | 66 | #endif // FILE_H 67 | -------------------------------------------------------------------------------- /Client-EChat/device/screenshot.cpp: -------------------------------------------------------------------------------- 1 | #include "screenshot.h" 2 | 3 | ScreenShot::ScreenShot(QWidget *parent) 4 | : QMainWindow(parent), m_isMousePressed(false), m_startPos(1,1), m_endPos(1,1) 5 | { 6 | // this->setWindowFlag(Qt::WindowStaysOnTopHint); 7 | // 设置窗口属性 8 | this->setWindowFlag(Qt::FramelessWindowHint); 9 | this->setAttribute(Qt::WA_TranslucentBackground); 10 | 11 | m_screenPicture = new QPixmap(); 12 | m_screenMenu = new QMenu(this); 13 | m_screenMenu->addAction("完成", this,[=]{ 14 | // 获取截屏内容 15 | QRect rect(getCapturedRect(m_startPos, m_endPos)); 16 | QPixmap pixmap = m_screenPicture->copy(rect); 17 | emit screenImage(pixmap); 18 | 19 | this->hide(); 20 | clearScreenCaptureInfo(); 21 | }); 22 | m_screenMenu->addAction("保存", this,[=]{ 23 | QRect rect(getCapturedRect(m_startPos, m_endPos)); 24 | QString fileName = SCREENSHOT_PATH(selfId) + "/EC截图" + CURRENT_DATETIME + ".png"; 25 | qDebug()<copy(rect).save( fileName , "png"); 27 | this->hide(); 28 | clearScreenCaptureInfo(); 29 | }); 30 | m_screenMenu->addAction("保存全屏", this,[=]{ 31 | QString fileName = SCREENSHOT_PATH(selfId) + "/EC截图" + CURRENT_DATETIME + ".png"; 32 | m_screenPicture->save( fileName , "png"); 33 | this->hide(); 34 | clearScreenCaptureInfo(); 35 | }); 36 | } 37 | 38 | ScreenShot::~ScreenShot() 39 | { 40 | if(m_screenPicture != nullptr){ 41 | delete m_screenPicture; 42 | } 43 | } 44 | 45 | void ScreenShot::showEvent(QShowEvent *) 46 | { 47 | QSize desktopSize = QApplication::desktop()->size(); 48 | QScreen *pscreen = QApplication::primaryScreen(); 49 | *m_screenPicture = pscreen->grabWindow(QApplication::desktop()->winId(), 0, 0, desktopSize.width(), desktopSize.height()); 50 | 51 | QPixmap pix(desktopSize.width(), desktopSize.height()); 52 | pix.fill((QColor(0, 0, 0, 150))); 53 | backgroundPicture = new QPixmap(*m_screenPicture); 54 | QPainter painter(backgroundPicture); 55 | painter.drawPixmap(0, 0, pix); 56 | } 57 | 58 | QRect ScreenShot::getCapturedRect(QPoint startpos, QPoint endpos) 59 | { 60 | if(startpos == endpos){ 61 | return QRect(); 62 | } 63 | QPoint tmpTopLeftPos = startpos, tmpBottomRightPos = endpos; 64 | if(endpos.x() < startpos.x()){ 65 | tmpBottomRightPos.setX(startpos.x()); 66 | tmpTopLeftPos.setX(endpos.x()); 67 | } 68 | if(endpos.y() < startpos.y()){ 69 | tmpBottomRightPos.setY(startpos.y()); 70 | tmpTopLeftPos.setY(endpos.y()); 71 | } 72 | return QRect(tmpTopLeftPos, tmpBottomRightPos); 73 | } 74 | 75 | void ScreenShot::paintEvent(QPaintEvent *) 76 | { 77 | QPainter painter(this); 78 | 79 | QPen pen; 80 | pen.setColor(Qt::white); 81 | pen.setWidth(2); 82 | painter.setPen(pen); 83 | painter.drawPixmap(0, 0, *backgroundPicture); 84 | 85 | QRect rect(getCapturedRect(m_startPos, m_endPos)); 86 | if (rect.isValid()) { 87 | painter.drawPixmap(rect.x(), rect.y(), m_screenPicture->copy(rect)); 88 | } 89 | pen.setColor(Qt::white); 90 | painter.setPen(pen); 91 | painter.drawText(rect.x(), rect.y() - 8, tr("%1 x %2 px | (Enter快捷完成截图,鼠标右击更多操作!)") 92 | .arg(rect.width()) 93 | .arg(rect.height())); 94 | } 95 | 96 | void ScreenShot::mouseMoveEvent(QMouseEvent *event) 97 | { 98 | if(m_isMousePressed){ 99 | QPoint tmpPos = event->pos(); 100 | m_endPos = tmpPos; 101 | this->update(); 102 | } 103 | } 104 | 105 | void ScreenShot::mousePressEvent(QMouseEvent *event) 106 | { 107 | if(event->button() == Qt::LeftButton){ 108 | m_isMousePressed = true; 109 | m_startPos = event->pos(); 110 | } 111 | } 112 | 113 | void ScreenShot::mouseReleaseEvent(QMouseEvent *) { m_isMousePressed = false; } 114 | 115 | void ScreenShot::contextMenuEvent(QContextMenuEvent *) 116 | { 117 | this->setCursor(Qt::ArrowCursor); 118 | m_screenMenu->exec(cursor().pos()); 119 | } 120 | 121 | void ScreenShot::clearScreenCaptureInfo() { m_startPos = m_endPos; } 122 | 123 | void ScreenShot::keyPressEvent(QKeyEvent *event) 124 | { 125 | if(event->key() == Qt::Key_Escape){ 126 | this->hide(); 127 | clearScreenCaptureInfo(); 128 | }else if(event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return){ 129 | // 获取截屏内容 130 | QRect rect(getCapturedRect(m_startPos, m_endPos)); 131 | QPixmap pixmap = m_screenPicture->copy(rect); 132 | emit screenImage(pixmap); 133 | 134 | this->hide(); 135 | clearScreenCaptureInfo(); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Client-EChat/device/screenshot.h: -------------------------------------------------------------------------------- 1 | #ifndef SCREENSHOT_H 2 | #define SCREENSHOT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "global.h" 18 | 19 | #define CURRENT_DATETIME QDateTime::currentDateTime().toString("yyyyMMddhhmmsszzz") 20 | 21 | class ScreenShot : public QMainWindow 22 | { 23 | Q_OBJECT 24 | public: 25 | explicit ScreenShot(QWidget *parent = nullptr); 26 | ~ScreenShot(); 27 | 28 | protected: 29 | void showEvent(QShowEvent *); 30 | void paintEvent(QPaintEvent *); 31 | void mouseMoveEvent(QMouseEvent *event); 32 | void mousePressEvent(QMouseEvent *event); 33 | void mouseReleaseEvent(QMouseEvent *event); 34 | void contextMenuEvent(QContextMenuEvent *event); 35 | void keyPressEvent(QKeyEvent *event); 36 | 37 | signals: 38 | void screenImage(QPixmap pixmap); 39 | 40 | private: 41 | QRect getCapturedRect(QPoint startpos, QPoint endpos); 42 | void clearScreenCaptureInfo(); 43 | 44 | bool m_isMousePressed; 45 | QPixmap *m_screenPicture; 46 | QPixmap *backgroundPicture; 47 | QPoint m_startPos, m_endPos; 48 | QMenu *m_screenMenu; 49 | }; 50 | 51 | #endif // SCREENSHOT_H 52 | -------------------------------------------------------------------------------- /Client-EChat/emo/emoji.cpp: -------------------------------------------------------------------------------- 1 | #include "emoji.h" 2 | #include "ui_emoji.h" 3 | 4 | Emoji::Emoji(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::Emoji) 7 | { 8 | ui->setupUi(this); 9 | 10 | // char32_t t[] = {0x1F601,0x0}; //加上0x00防止表情后面跟随乱码 11 | // for(char32_t i = 0x1F601 ; i <= 0x1F64F ; ++i) 12 | // { 13 | // t[0] = i; 14 | // QString::fromUcs4(t); 15 | // } 16 | 17 | int row = 0; 18 | int column = 0; 19 | char32_t emojiChar[] = {0x1F601,0x0}; //加上0x00防止表情后面跟随乱码 20 | char32_t emojiUnicode = 0x1F601; 21 | 22 | // 第一页 23 | for(int i=0; isetMinimumSize(QSize(342,156)); 60 | this->setMaximumSize(QSize(342,156)); 61 | ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 62 | } 63 | 64 | void Emoji::setMin() 65 | { 66 | this->setMinimumSize(QSize(203,156)); 67 | this->setMaximumSize(QSize(203,156)); 68 | ui->scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); 69 | } 70 | 71 | void Emoji::gridInsertWidget(QString text,int row,int column) 72 | { 73 | QPushButton *btn = new QPushButton(this); 74 | QFont font; 75 | font.setFamily("微软雅黑"); 76 | font.setPointSize(10); 77 | font.setStyleStrategy(QFont::PreferAntialias); 78 | btn->setFont(font); 79 | btn->setText(text); 80 | btn->setMaximumSize(QSize(28,28)); 81 | btn->setMinimumSize(QSize(28,28)); 82 | 83 | ui->gridLayout_emoji->addWidget(btn,row,column); 84 | connect(btn,&QPushButton::clicked,this,[=]{ emit emo(btn->text()); }); //表情包信号 85 | } 86 | 87 | 88 | -------------------------------------------------------------------------------- /Client-EChat/emo/emoji.h: -------------------------------------------------------------------------------- 1 | #ifndef EMOJI_H 2 | #define EMOJI_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #define MAX_ROW 5 9 | #define MAX_COLUMN 12 10 | #define MAX_EMO 60 11 | 12 | 13 | namespace Ui { 14 | class Emoji; 15 | } 16 | 17 | class Emoji : public QWidget 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit Emoji(QWidget *parent = nullptr); 23 | ~Emoji(); 24 | 25 | void setMax(); 26 | void setMin(); 27 | 28 | signals: 29 | void emo(QString text); 30 | 31 | private: 32 | void gridInsertWidget(QString text,int row,int column); 33 | 34 | 35 | Ui::Emoji *ui; 36 | }; 37 | 38 | #endif // EMOJI_H 39 | -------------------------------------------------------------------------------- /Client-EChat/emo/emoji.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Emoji 4 | 5 | 6 | 7 | 0 8 | 0 9 | 203 10 | 156 11 | 12 | 13 | 14 | 15 | 203 16 | 156 17 | 18 | 19 | 20 | 21 | 342 22 | 156 23 | 24 | 25 | 26 | Form 27 | 28 | 29 | 30 | 31 | 32 | 33 | 2 34 | 35 | 36 | 2 37 | 38 | 39 | 2 40 | 41 | 42 | 2 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | 51 | 0 52 | 0 53 | 54 | 55 | 56 | 57 | 16777215 58 | 16777215 59 | 60 | 61 | 62 | 63 | 微软雅黑 64 | PreferAntialias 65 | 66 | 67 | 68 | QScrollBar:horizontal 69 | { 70 | height:9px; 71 | background:rgb(240,240,240); 72 | padding-left:9px; 73 | padding-right:9px; 74 | } 75 | QScrollBar::handle:horizontal 76 | { 77 | height:9px; 78 | background:rgba(0,0,0,25%); 79 | border-radius:4px; 80 | } 81 | QScrollBar::handle:horizontal:hover 82 | { 83 | height:9px; 84 | background:rgba(0,0,0,50%); 85 | border-radius:4px; 86 | min-height:20; 87 | } 88 | 89 | /*按钮控件样式*/ 90 | QPushButton{ 91 | background-color:rgb(240, 240, 240); 92 | border:none; 93 | } 94 | QPushButton:hover{ 95 | background-color:rgb(230, 230, 230); 96 | } 97 | QPushButton:pressed{ 98 | background-color:rgb(230, 230, 230); 99 | } 100 | 101 | 102 | 103 | 104 | 105 | Qt::ScrollBarAlwaysOff 106 | 107 | 108 | Qt::ScrollBarAlwaysOn 109 | 110 | 111 | true 112 | 113 | 114 | 115 | 116 | 0 117 | 0 118 | 197 119 | 141 120 | 121 | 122 | 123 | 124 | 0 125 | 126 | 127 | 0 128 | 129 | 130 | 0 131 | 132 | 133 | 0 134 | 135 | 136 | 0 137 | 138 | 139 | 140 | 141 | 0 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /Client-EChat/global.cpp: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | 3 | int selfId; // 当前用户id 4 | int lastId; //上次用户的id 5 | QString selfNickname; 6 | int selfPicture; 7 | QString defaultPicture = ":/img/defaultPicture.ico"; 8 | 9 | bool networkNormal = false; //网络是否正常,只有与服务器保持连接才为true 10 | 11 | bool modifyPassword = false; 12 | 13 | int msgCounts; 14 | 15 | #include 16 | #include 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Client-EChat/global.h: -------------------------------------------------------------------------------- 1 | #ifndef GLOBAL_H 2 | #define GLOBAL_H 3 | 4 | #include 5 | #include 6 | 7 | //个人的基本信息,非常重要,多次被其他地方使用!!!! 8 | extern int selfId; 9 | extern int lastId; // 是一个用户遗留的id 10 | extern QString selfNickname; 11 | extern int selfPicture; 12 | 13 | //extern bool userExiting; 14 | extern bool networkNormal; // 网络情况 15 | 16 | extern bool modifyPassword; //修改密码,用来表示退出情况是修改密码所致 17 | 18 | extern int msgCounts; //消息数量 19 | 20 | #define MSG_COUNT 80 21 | 22 | #define MSG_TEXT "text" 23 | #define MSG_IMAGE "image" 24 | #define MSG_FILE "file" 25 | 26 | #define DATA_FOLDER "EChat Data" 27 | #define USER_FOLDER(userId) QString::number(userId) 28 | #define AUDIO_FOLDER "Audio" 29 | #define CHATMSG_FOLDER "ChatMsg" 30 | #define FILE_FOLDER "File" 31 | #define IMAGE_FOLDER "Image" 32 | #define IMAGE_HEADPICTURE_FOLDER "HeadPicture" 33 | #define SCREENSHOT_FOLDER "ScreenShot" 34 | #define VIDEO_FOLDER "Video" 35 | 36 | #define CURR_PATH QCoreApplication::applicationDirPath() 37 | #define CONFIG_FILE CURR_PATH + "/config.ini" 38 | #define DATA_PATH CURR_PATH+"/"+DATA_FOLDER 39 | #define USER_PATH(userId) DATA_PATH+"/"+USER_FOLDER(userId) 40 | 41 | #define AUDIO_PATH(userId) USER_PATH(userId)+"/"+AUDIO_FOLDER 42 | #define CHATMSG_PATH(userId) USER_PATH(userId)+"/"+CHATMSG_FOLDER 43 | #define FILE_PATH(userId) USER_PATH(userId)+"/"+FILE_FOLDER 44 | 45 | #define IMAGE_PATH(userId) USER_PATH(userId)+"/"+IMAGE_FOLDER 46 | #define IMAGE_HEADPICTURE_PATH(userId) IMAGE_PATH(userId)+"/"+IMAGE_HEADPICTURE_FOLDER 47 | 48 | #define SCREENSHOT_PATH(userId) USER_PATH(userId)+"/"+SCREENSHOT_FOLDER 49 | #define VIDEO_PATH(userId) USER_PATH(userId)+"/"+VIDEO_FOLDER 50 | 51 | // ItemFriend 52 | #define SELECT_BACKGROUND "#widget_background{background-color:rgb(225, 225, 225);}" 53 | #define ENTER_BACKGROUND "#widget_background{background-color:rgb(235, 235, 235);}" 54 | #define LEAVE_BACKGROUND "#widget_background{background-color:rgb(240, 240, 240);}" 55 | 56 | // ItemChatObject 57 | #define ONLINE_STATE "#lab_onlineState{background-color:rgb(30, 215, 109);border-radius:6px;}" 58 | #define OFFLINE_STATE "#lab_onlineState{background-color:rgb(135,135,135);border-radius:6px;}" 59 | 60 | #define NUM_REG "^[0-9]+$" 61 | #define PWD_REG "^[A-Za-z0-9]+$" 62 | #define ZH_REG "^[\u4e00-\u9fa5]{0,}$" 63 | #define ZH_EN_NUM_REG "^[A-Za-z\u4E00-\u9FA50-9]+$" 64 | #define EMAIL_REG "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$" 65 | //#define PHONE_REG "/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/" //??有问题 66 | 67 | 68 | 69 | #endif // GLOBAL_H 70 | -------------------------------------------------------------------------------- /Client-EChat/img/EChat.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/EChat.ico -------------------------------------------------------------------------------- /Client-EChat/img/EChat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/EChat.png -------------------------------------------------------------------------------- /Client-EChat/img/account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/account.png -------------------------------------------------------------------------------- /Client-EChat/img/addContanct-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/addContanct-hover.png -------------------------------------------------------------------------------- /Client-EChat/img/addContanct-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/addContanct-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/arrow-left.png -------------------------------------------------------------------------------- /Client-EChat/img/arrow-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/arrow-right.png -------------------------------------------------------------------------------- /Client-EChat/img/comBoxFlod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/comBoxFlod.png -------------------------------------------------------------------------------- /Client-EChat/img/contact-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/contact-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/contact-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/contact-hover.png -------------------------------------------------------------------------------- /Client-EChat/img/contact-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/contact-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/defaultPicture.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/defaultPicture.ico -------------------------------------------------------------------------------- /Client-EChat/img/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/edit.png -------------------------------------------------------------------------------- /Client-EChat/img/emo-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/emo-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/emo-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/emo-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/file.png -------------------------------------------------------------------------------- /Client-EChat/img/flod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/flod.png -------------------------------------------------------------------------------- /Client-EChat/img/folder-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/folder-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/folder-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/folder-hover.png -------------------------------------------------------------------------------- /Client-EChat/img/folder-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/folder-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/ghost.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/ghost.gif -------------------------------------------------------------------------------- /Client-EChat/img/head/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/1.png -------------------------------------------------------------------------------- /Client-EChat/img/head/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/10.png -------------------------------------------------------------------------------- /Client-EChat/img/head/1001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/1001.png -------------------------------------------------------------------------------- /Client-EChat/img/head/1002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/1002.png -------------------------------------------------------------------------------- /Client-EChat/img/head/1003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/1003.png -------------------------------------------------------------------------------- /Client-EChat/img/head/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/11.png -------------------------------------------------------------------------------- /Client-EChat/img/head/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/12.png -------------------------------------------------------------------------------- /Client-EChat/img/head/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/13.png -------------------------------------------------------------------------------- /Client-EChat/img/head/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/14.png -------------------------------------------------------------------------------- /Client-EChat/img/head/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/15.png -------------------------------------------------------------------------------- /Client-EChat/img/head/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/16.png -------------------------------------------------------------------------------- /Client-EChat/img/head/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/17.png -------------------------------------------------------------------------------- /Client-EChat/img/head/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/18.png -------------------------------------------------------------------------------- /Client-EChat/img/head/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/19.png -------------------------------------------------------------------------------- /Client-EChat/img/head/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/2.png -------------------------------------------------------------------------------- /Client-EChat/img/head/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/20.png -------------------------------------------------------------------------------- /Client-EChat/img/head/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/21.png -------------------------------------------------------------------------------- /Client-EChat/img/head/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/3.png -------------------------------------------------------------------------------- /Client-EChat/img/head/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/4.png -------------------------------------------------------------------------------- /Client-EChat/img/head/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/5.png -------------------------------------------------------------------------------- /Client-EChat/img/head/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/6.png -------------------------------------------------------------------------------- /Client-EChat/img/head/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/7.png -------------------------------------------------------------------------------- /Client-EChat/img/head/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/8.png -------------------------------------------------------------------------------- /Client-EChat/img/head/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/9.png -------------------------------------------------------------------------------- /Client-EChat/img/head/group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/group.png -------------------------------------------------------------------------------- /Client-EChat/img/head/person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/head/person.png -------------------------------------------------------------------------------- /Client-EChat/img/image-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/image-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/image-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/image-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/lineLoading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/lineLoading.gif -------------------------------------------------------------------------------- /Client-EChat/img/more-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/more-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/more-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/more-hover.png -------------------------------------------------------------------------------- /Client-EChat/img/more-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/more-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/msg-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/msg-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/msg-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/msg-hover.png -------------------------------------------------------------------------------- /Client-EChat/img/msg-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/msg-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/password.png -------------------------------------------------------------------------------- /Client-EChat/img/pwdClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/pwdClose.png -------------------------------------------------------------------------------- /Client-EChat/img/pwdOpen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/pwdOpen.png -------------------------------------------------------------------------------- /Client-EChat/img/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/refresh.png -------------------------------------------------------------------------------- /Client-EChat/img/resetPwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/resetPwd.png -------------------------------------------------------------------------------- /Client-EChat/img/rocket.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/rocket.gif -------------------------------------------------------------------------------- /Client-EChat/img/screenshot-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/screenshot-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/screenshot-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/screenshot-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/search.png -------------------------------------------------------------------------------- /Client-EChat/img/setting-clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/setting-clicked.png -------------------------------------------------------------------------------- /Client-EChat/img/setting-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/setting-hover.png -------------------------------------------------------------------------------- /Client-EChat/img/setting-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/setting-normal.png -------------------------------------------------------------------------------- /Client-EChat/img/skypeLoader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/skypeLoader.gif -------------------------------------------------------------------------------- /Client-EChat/img/sure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/sure.png -------------------------------------------------------------------------------- /Client-EChat/img/switchLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/switchLeft.png -------------------------------------------------------------------------------- /Client-EChat/img/switchRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/switchRight.png -------------------------------------------------------------------------------- /Client-EChat/img/testPicture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/testPicture.jpg -------------------------------------------------------------------------------- /Client-EChat/img/threeLoading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Client-EChat/img/threeLoading.gif -------------------------------------------------------------------------------- /Client-EChat/item/headpicture.cpp: -------------------------------------------------------------------------------- 1 | #include "headpicture.h" 2 | #include "ui_headpicture.h" 3 | 4 | HeadPicture::HeadPicture(QWidget *parent) : 5 | QWidget(parent), 6 | ui(new Ui::HeadPicture) 7 | { 8 | ui->setupUi(this); 9 | 10 | // 设置窗口阴影 11 | QGraphicsDropShadowEffect *shadow; 12 | shadow = new QGraphicsDropShadowEffect(this); 13 | shadow->setOffset(0, 0); // 设置阴影距离 14 | shadow->setColor(QColor(55, 55, 55)); // 设置阴影颜色 15 | shadow->setBlurRadius(5); // 设置阴影圆角 16 | this->setGraphicsEffect(shadow); 17 | 18 | connect(ui->btn_1,&QPushButton::clicked,this,[=]{ emit pictureIndex(1); }); 19 | connect(ui->btn_2,&QPushButton::clicked,this,[=]{ emit pictureIndex(2); }); 20 | connect(ui->btn_3,&QPushButton::clicked,this,[=]{ emit pictureIndex(3); }); 21 | connect(ui->btn_4,&QPushButton::clicked,this,[=]{ emit pictureIndex(4); }); 22 | connect(ui->btn_5,&QPushButton::clicked,this,[=]{ emit pictureIndex(5); }); 23 | connect(ui->btn_6,&QPushButton::clicked,this,[=]{ emit pictureIndex(6); }); 24 | connect(ui->btn_7,&QPushButton::clicked,this,[=]{ emit pictureIndex(7); }); 25 | connect(ui->btn_8,&QPushButton::clicked,this,[=]{ emit pictureIndex(8); }); 26 | connect(ui->btn_9,&QPushButton::clicked,this,[=]{ emit pictureIndex(9); }); 27 | connect(ui->btn_10,&QPushButton::clicked,this,[=]{ emit pictureIndex(10); }); 28 | connect(ui->btn_11,&QPushButton::clicked,this,[=]{ emit pictureIndex(11); }); 29 | connect(ui->btn_12,&QPushButton::clicked,this,[=]{ emit pictureIndex(12); }); 30 | connect(ui->btn_13,&QPushButton::clicked,this,[=]{ emit pictureIndex(13); }); 31 | connect(ui->btn_14,&QPushButton::clicked,this,[=]{ emit pictureIndex(14); }); 32 | connect(ui->btn_15,&QPushButton::clicked,this,[=]{ emit pictureIndex(15); }); 33 | connect(ui->btn_16,&QPushButton::clicked,this,[=]{ emit pictureIndex(16); }); 34 | connect(ui->btn_17,&QPushButton::clicked,this,[=]{ emit pictureIndex(17); }); 35 | connect(ui->btn_18,&QPushButton::clicked,this,[=]{ emit pictureIndex(18); }); 36 | connect(ui->btn_19,&QPushButton::clicked,this,[=]{ emit pictureIndex(19); }); 37 | connect(ui->btn_20,&QPushButton::clicked,this,[=]{ emit pictureIndex(20); }); 38 | connect(ui->btn_21,&QPushButton::clicked,this,[=]{ emit pictureIndex(21); }); 39 | } 40 | 41 | HeadPicture::~HeadPicture() 42 | { 43 | delete ui; 44 | } 45 | 46 | void HeadPicture::setPictureType(const int &type) 47 | { 48 | if(type == 0 || type == 1) 49 | ui->stackedWidget->setCurrentIndex(type); 50 | } 51 | 52 | void HeadPicture::paintEvent(QPaintEvent *event) 53 | { 54 | QPainter painter(this); 55 | painter.setRenderHint(QPainter::Antialiasing); 56 | painter.setBrush(QColor(245, 246, 247)); // 245, 246, 247 57 | painter.setPen(Qt::transparent); 58 | painter.drawRoundedRect(QRect(1, 1, this->width() - 2, this->height() - 2), 6, 6); 59 | QWidget::paintEvent(event); 60 | } 61 | -------------------------------------------------------------------------------- /Client-EChat/item/headpicture.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADPICTURE_H 2 | #define HEADPICTURE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Ui { 10 | class HeadPicture; 11 | } 12 | 13 | class HeadPicture : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit HeadPicture(QWidget *parent = nullptr); 19 | ~HeadPicture(); 20 | 21 | void setPictureType(const int &type); //0好友 1群聊 22 | 23 | signals: 24 | void pictureIndex(const int index); 25 | 26 | protected: 27 | void paintEvent(QPaintEvent *event) override; 28 | // void mousePressEvent(QMouseEvent *event) override; 29 | // void mouseReleaseEvent(QMouseEvent *event) override; 30 | // void mouseMoveEvent(QMouseEvent *event) override; 31 | // bool eventFilter(QObject *watched, QEvent *event) override; 32 | 33 | private: 34 | Ui::HeadPicture *ui; 35 | }; 36 | 37 | #endif // HEADPICTURE_H 38 | -------------------------------------------------------------------------------- /Client-EChat/item/itemchatobject.cpp: -------------------------------------------------------------------------------- 1 | #include "item/ItemChatObject.h" 2 | 3 | #include "ui_itemchatobject.h" 4 | 5 | ItemChatObject::ItemChatObject(QWidget *parent) 6 | : QWidget(parent), menu(nullptr), keepBackground(false), ui(new Ui::ItemChatObject) 7 | { 8 | ui->setupUi(this); 9 | 10 | menu = new QMenu(this); 11 | // menu->addAction("置顶", [=] { emit topCliked(); }); 12 | menu->addAction("移除", [=] { emit removeCliked(); }); 13 | } 14 | 15 | ItemChatObject::~ItemChatObject(){ delete ui; } 16 | 17 | void ItemChatObject::setPicture(const int &type, int picture) 18 | { 19 | // qDebug()<lab_picture->setPixmap(QPixmap(":/img/head/group.png")); //默认头像 25 | else 26 | ui->lab_picture->setPixmap(QPixmap(":/img/head/person.png")); //默认头像 27 | }else{ 28 | QPixmap pixmap; 29 | _picture = QString(":/img/head/%1.png").arg(QString::number(picture)); 30 | pixmap.load(_picture); 31 | ui->lab_picture->setPixmap(pixmap); 32 | } 33 | } 34 | 35 | // 2019级计算机... 36 | void ItemChatObject::setNickname(const QString &nickname) 37 | { 38 | // 39 | ui->lab_nickname->setText(nickname); 40 | } 41 | 42 | // 20:28 43 | void ItemChatObject::setRecentChatTime(const QString &dateTime) 44 | { 45 | QStringList list = dateTime.split(" "); 46 | QString time = list.at(1).left(5); 47 | ui->lab_recentChatTime->setText(time); 48 | ui->lab_recentChatTime->setToolTip(QString("最近聊天:\n%1 %2").arg(list.at(0).right(5),time)); 49 | } 50 | 51 | // 晚风来的正巧正巧晚... 52 | void ItemChatObject::setRecentChatMsg(const QString &msg) 53 | { 54 | QString content = msg; 55 | content = content.remove("\n"); 56 | ui->lab_recentChatMsg->setText("[最近]" + content); 57 | // ui->lab_recentChatMsg->setToolTip(msg); 58 | } 59 | 60 | // 设置未读消息数量 61 | void ItemChatObject::setRecentUnread(const int &counts) 62 | { 63 | if (counts <= 0) 64 | return; 65 | 66 | if (counts <= 99) 67 | ui->lab_recentUnread->setText(QString("%1+").arg(QString::number(counts))); 68 | else 69 | ui->lab_recentUnread->setText("99+"); 70 | } 71 | 72 | void ItemChatObject::clearRecentUnread() { ui->lab_recentUnread->clear(); } 73 | 74 | void ItemChatObject::addRecentUnread() 75 | { 76 | ++msgCounts; 77 | QString text = ui->lab_recentUnread->text(); 78 | int unread = text.leftRef(text.length()- 1).toInt() + 1; 79 | ui->lab_recentUnread->setText(QString("%1+").arg(QString::number( unread ))); 80 | } 81 | 82 | void ItemChatObject::setOnlineState(const bool &state) 83 | { 84 | if (state){ 85 | ui->lab_onlineState->setStyleSheet(ONLINE_STATE); 86 | ui->lab_onlineState->setToolTip("线上"); 87 | }else{ 88 | ui->lab_onlineState->setStyleSheet(OFFLINE_STATE); 89 | ui->lab_onlineState->setToolTip("已下"); 90 | } 91 | } 92 | 93 | void ItemChatObject::setOnlineStateVisible(const bool &state) { ui->lab_onlineState->setVisible(state); } 94 | 95 | void ItemChatObject::setBackground(const bool &state) 96 | { 97 | if (state) { 98 | ui->widget_background->setStyleSheet(SELECT_BACKGROUND); 99 | keepBackground = state; 100 | } else { 101 | keepBackground = state; 102 | ui->widget_background->setStyleSheet(LEAVE_BACKGROUND); 103 | } 104 | } 105 | 106 | bool ItemChatObject::getOnlineState() 107 | { 108 | bool state = false; 109 | if ("线上" == ui->lab_onlineState->toolTip()) 110 | state = true; 111 | return state; 112 | } 113 | 114 | void ItemChatObject::contextMenuEvent(QContextMenuEvent *event) 115 | { 116 | menu->exec(QCursor::pos()); // 弹出右键菜单 117 | event->accept(); 118 | } 119 | 120 | void ItemChatObject::enterEvent(QEvent *event) 121 | { 122 | if (!keepBackground) 123 | ui->widget_background->setStyleSheet(ENTER_BACKGROUND); 124 | } 125 | 126 | void ItemChatObject::leaveEvent(QEvent *) 127 | { 128 | if (!keepBackground) 129 | ui->widget_background->setStyleSheet(LEAVE_BACKGROUND); 130 | } 131 | 132 | void ItemChatObject::mouseReleaseEvent(QMouseEvent *event) 133 | { 134 | emit clicked(); 135 | QWidget::mouseReleaseEvent(event); 136 | } 137 | 138 | //void ItemChatObject::mouseMoveEvent(QMouseEvent *event) 139 | //{ 140 | // Q_UNUSED(event); 141 | // return; 142 | //} 143 | 144 | -------------------------------------------------------------------------------- /Client-EChat/item/itemchatobject.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMCHATOBJECT_H 2 | #define ITEMCHATOBJECT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "global.h" 15 | #include "device/file.h" 16 | 17 | namespace Ui { 18 | class ItemChatObject; 19 | } 20 | 21 | class ItemChatObject : public QWidget 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit ItemChatObject(QWidget *parent = nullptr); 27 | ~ItemChatObject(); 28 | 29 | void setPicture(const int &type,int picture = 0); 30 | void setNickname(const QString &nickname); 31 | void setRecentChatTime(const QString &dateTime); 32 | void setRecentChatMsg(const QString &msg); 33 | void setRecentUnread(const int &counts); 34 | void clearRecentUnread(); 35 | void addRecentUnread(); 36 | void setOnlineState(const bool &state); 37 | void setOnlineStateVisible(const bool &state); 38 | void setBackground(const bool &state); 39 | 40 | bool getOnlineState(); 41 | 42 | signals: 43 | void clicked(); 44 | void removeCliked(); 45 | void topCliked(); 46 | 47 | protected: 48 | // void paintEvent(QPaintEvent *event) override; 49 | void contextMenuEvent(QContextMenuEvent *event) override; 50 | void enterEvent(QEvent *event) override; 51 | void leaveEvent(QEvent *event) override; 52 | // bool eventFilter(QObject *watched, QEvent *event) override; 53 | // void mousePressEvent(QMouseEvent *event) override; 54 | void mouseReleaseEvent(QMouseEvent *event) override; 55 | // void mouseMoveEvent(QMouseEvent *event) override; 56 | // bool event(QEvent *event) override; 57 | 58 | private: 59 | QMenu *menu; 60 | bool keepBackground; 61 | 62 | private: 63 | Ui::ItemChatObject *ui; 64 | }; 65 | 66 | #endif // ITEMCHATOBJECT_H 67 | -------------------------------------------------------------------------------- /Client-EChat/item/itemcontact.cpp: -------------------------------------------------------------------------------- 1 | #include "item/itemcontact.h" 2 | 3 | #include "ui_itemcontact.h" 4 | 5 | ItemContact::ItemContact(QWidget *parent) : QWidget(parent), keepBackground(false), ui(new Ui::ItemContact) { 6 | ui->setupUi(this); 7 | this->setMinimumSize(QSize(242,50)); 8 | this->setMaximumSize(QSize(242,50)); 9 | } 10 | 11 | ItemContact::~ItemContact() { delete ui;} 12 | 13 | void ItemContact::setPicture(const int &type,int picture) 14 | { 15 | QString _picture; 16 | // 群聊 17 | if(picture <= 0){ 18 | if(type) 19 | ui->lab_picture->setPixmap(QPixmap(":/img/head/group.png")); //默认头像 20 | else 21 | ui->lab_picture->setPixmap(QPixmap(":/img/head/person.png")); //默认头像 22 | }else{ 23 | QPixmap pixmap; 24 | _picture = QString(":/img/head/%1.png").arg(QString::number(picture)); 25 | pixmap.load(_picture); 26 | ui->lab_picture->setPixmap(pixmap); 27 | } 28 | } 29 | 30 | void ItemContact::setNickname(const QString &nickname) { ui->lab_nickname->setText(nickname); } 31 | 32 | void ItemContact::setId(const int &id) { ui->lab_id->setText(QString::number(id)); } 33 | 34 | void ItemContact::setApplicants(const int &counts) 35 | { 36 | ui->lab_id->setText(QString("%1+").arg(QString::number(counts))); 37 | } 38 | 39 | void ItemContact::removeApplicants() 40 | { 41 | QString tip = ui->lab_id->text(); 42 | int counts = tip.leftRef(tip.length() - 1).toInt() - 1; 43 | if(0 == counts) 44 | ui->lab_id->clear(); 45 | else{ 46 | ui->lab_id->setText(QString("%1+").arg(QString::number(counts))); 47 | } 48 | } 49 | 50 | void ItemContact::setBackground(const bool &state) 51 | { 52 | if (state) { 53 | ui->widget_background->setStyleSheet(SELECT_BACKGROUND); 54 | keepBackground = state; 55 | } else { 56 | keepBackground = state; 57 | ui->widget_background->setStyleSheet(LEAVE_BACKGROUND); 58 | } 59 | } 60 | 61 | void ItemContact::setTipStyle() 62 | { 63 | QFont font; 64 | font.setFamily("微软雅黑"); 65 | font.setPointSize(9); 66 | font.setBold(true); 67 | ui->lab_id->setFont(font); 68 | ui->lab_id->setAlignment(Qt::AlignRight); 69 | } 70 | 71 | int ItemContact::getContactId() { return ui->lab_id->text().toInt(); } 72 | 73 | void ItemContact::enterEvent(QEvent *) 74 | { 75 | if (!keepBackground) 76 | ui->widget_background->setStyleSheet(ENTER_BACKGROUND); 77 | } 78 | 79 | void ItemContact::leaveEvent(QEvent *) 80 | { 81 | if (!keepBackground) 82 | ui->widget_background->setStyleSheet(LEAVE_BACKGROUND); 83 | } 84 | 85 | void ItemContact::mouseReleaseEvent(QMouseEvent *event) 86 | { 87 | emit clicked(); 88 | QWidget::mouseReleaseEvent(event); 89 | } 90 | 91 | void ItemContact::mouseMoveEvent(QMouseEvent *event) 92 | { 93 | Q_UNUSED(event); 94 | return; 95 | } 96 | -------------------------------------------------------------------------------- /Client-EChat/item/itemcontact.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMCONTACT_H 2 | #define ITEMCONTACT_H 3 | 4 | #include 5 | 6 | #include "global.h" 7 | #include 8 | 9 | namespace Ui { 10 | class ItemContact; 11 | } 12 | 13 | class ItemContact : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit ItemContact(QWidget *parent = nullptr); 19 | ~ItemContact(); 20 | 21 | void setPicture(const int &type,int picture=0); 22 | void setNickname(const QString &nickname); 23 | void setId(const int &id); 24 | void setApplicants(const int &counts); 25 | void removeApplicants(); 26 | void setBackground(const bool &state); 27 | void setTipStyle(); 28 | 29 | int getContactId(); 30 | 31 | signals: 32 | void clicked(); 33 | 34 | protected: 35 | void enterEvent(QEvent *) override; 36 | void leaveEvent(QEvent *) override; 37 | // bool eventFilter(QObject *watched, QEvent *event) override; 38 | // void mousePressEvent(QMouseEvent *event) override; 39 | void mouseReleaseEvent(QMouseEvent *event) override; 40 | void mouseMoveEvent(QMouseEvent *event) override; 41 | 42 | private: 43 | bool keepBackground; 44 | 45 | private: 46 | Ui::ItemContact *ui; 47 | }; 48 | 49 | #endif // ITEMCONTACT_H 50 | -------------------------------------------------------------------------------- /Client-EChat/item/itemcontact.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | ItemContact 4 | 5 | 6 | 7 | 0 8 | 0 9 | 242 10 | 50 11 | 12 | 13 | 14 | 15 | 242 16 | 50 17 | 18 | 19 | 20 | 21 | 242 22 | 50 23 | 24 | 25 | 26 | Form 27 | 28 | 29 | 30 | 31 | 32 | 33 | 0 34 | 35 | 36 | 0 37 | 38 | 39 | 0 40 | 41 | 42 | 0 43 | 44 | 45 | 0 46 | 47 | 48 | 49 | 50 | #widget_background{ 51 | background-color: rgb(240, 240, 240); 52 | } 53 | 54 | 55 | 56 | 10 57 | 58 | 59 | 5 60 | 61 | 62 | 10 63 | 64 | 65 | 5 66 | 67 | 68 | 8 69 | 70 | 71 | 0 72 | 73 | 74 | 75 | 76 | 77 | 36 78 | 36 79 | 80 | 81 | 82 | 83 | 36 84 | 36 85 | 86 | 87 | 88 | 89 | 90 | 91 | true 92 | 93 | 94 | false 95 | 96 | 97 | 98 | 99 | 100 | 101 | 0 102 | 103 | 104 | 105 | 106 | 107 | 0 108 | 18 109 | 110 | 111 | 112 | 113 | 16777215 114 | 18 115 | 116 | 117 | 118 | 119 | 微软雅黑 120 | 9 121 | true 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 0 134 | 18 135 | 136 | 137 | 138 | 139 | 16777215 140 | 18 141 | 142 | 143 | 144 | 145 | 微软雅黑 146 | 8 147 | false 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /Client-EChat/item/itemfriendapply.cpp: -------------------------------------------------------------------------------- 1 | #include "item/itemfriendapply.h" 2 | 3 | #include "ui_itemfriendapply.h" 4 | 5 | ItemFriendApply::ItemFriendApply(QWidget *parent) : QWidget(parent), ui(new Ui::ItemFriendApply) 6 | { 7 | ui->setupUi(this); 8 | ui->lab_nickname->installEventFilter(this); 9 | ui->lab_ps->installEventFilter(this); 10 | } 11 | 12 | ItemFriendApply::~ItemFriendApply() { delete ui; } 13 | 14 | void ItemFriendApply::setPicture(const int &type, int picture) 15 | { 16 | if (picture <= 0){ 17 | if(type) 18 | ui->lab_picture->setPixmap(QPixmap(":/img/head/group.png")); //默认头像 19 | else 20 | ui->lab_picture->setPixmap(QPixmap(":/img/head/person.png")); //默认头像 21 | }else{ 22 | QString _picture = QString(":/img/head/%1.png").arg(QString::number(picture)); 23 | QPixmap pixmap; 24 | pixmap.load(_picture); 25 | ui->lab_picture->setPixmap(pixmap); 26 | } 27 | } 28 | 29 | void ItemFriendApply::setNickname(const QString &nickname,const int &id,const int &type) 30 | { 31 | if(type){ 32 | ui->lab_nickname->setText(nickname +"[" + QString::number(id) + "]"); 33 | //tooltip 34 | } 35 | else{ 36 | ui->lab_nickname->setText(nickname); 37 | } 38 | } 39 | 40 | void ItemFriendApply::setId(const int &id,const int &type) 41 | { 42 | if(type) 43 | ui->lab_id->setText("[群]" + QString::number(id)); 44 | else 45 | ui->lab_id->setText("[友]"+ QString::number(id)); 46 | } 47 | 48 | void ItemFriendApply::setPs(const QString &ps) 49 | { 50 | if(ps.isEmpty()) 51 | ui->lab_ps->setText("附:你好呀!"); 52 | else { 53 | QString _ps = "附:" + ps;; 54 | ui->lab_ps->setText(_ps); 55 | if(ps.length() > 7) 56 | ui->lab_ps->setToolTip(_ps); 57 | } 58 | } 59 | 60 | int ItemFriendApply::getApplicantId() 61 | { 62 | // int id; 63 | // if(type){ 64 | // QStringList list = ui->lab_nickname->text().split("["); 65 | // id = list.at(1).leftRef(7).toInt(); 66 | // }else 67 | // id = ui->lab_id->text().rightRef(7).toInt(); 68 | 69 | return ui->lab_id->text().rightRef(7).toInt(); 70 | } 71 | 72 | int ItemFriendApply::getGroupId() 73 | { 74 | return ui->lab_id->text().rightRef(7).toInt(); 75 | } 76 | 77 | int ItemFriendApply::getType() 78 | { 79 | QString type = ui->lab_id->text().left(3); 80 | if("[群]" == type) 81 | return 1; 82 | return 0; 83 | } 84 | 85 | void ItemFriendApply::setAgree(const bool &state) 86 | { 87 | ui->btn_agree->setEnabled(false); 88 | ui->btn_refuse->setEnabled(false); 89 | if(state){ 90 | ui->btn_agree->setText("已同意"); 91 | }else{ 92 | ui->btn_refuse->setText("已拒绝"); 93 | } 94 | } 95 | 96 | bool ItemFriendApply::eventFilter(QObject *watched, QEvent *event) 97 | { 98 | if(event->type() == QEvent::ToolTip){ 99 | if(dynamic_cast(watched) == ui->lab_id || dynamic_cast(watched) == ui->lab_nickname) 100 | QToolTip::showText(QCursor::pos(), toolTip(), this); 101 | // QToolTip::showText(dynamic_cast(event)->globalPos(), toolTip(), this); //QEvent::Enter 102 | } 103 | return QWidget::eventFilter(watched, event); 104 | } 105 | 106 | void ItemFriendApply::on_btn_agree_clicked() { emit agree(); } 107 | 108 | void ItemFriendApply::on_btn_refuse_clicked() { emit refuse(); } 109 | 110 | -------------------------------------------------------------------------------- /Client-EChat/item/itemfriendapply.h: -------------------------------------------------------------------------------- 1 | #ifndef ITEMFRIENDAPPLY_H 2 | #define ITEMFRIENDAPPLY_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace Ui { 10 | class ItemFriendApply; 11 | } 12 | 13 | class ItemFriendApply : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit ItemFriendApply(QWidget *parent = nullptr); 19 | ~ItemFriendApply(); 20 | 21 | void setPicture(const int &type, int picture=0); 22 | void setNickname(const QString &nickname,const int &id,const int &type); 23 | void setId(const int &id,const int &type); 24 | void setPs(const QString &ps); 25 | 26 | int getApplicantId(); 27 | int getGroupId(); 28 | int getType(); 29 | 30 | void setAgree(const bool& state); 31 | 32 | protected: 33 | bool eventFilter(QObject *watched, QEvent *event) override; 34 | 35 | signals: 36 | void agree(); 37 | void refuse(); 38 | 39 | private slots: 40 | void on_btn_agree_clicked(); 41 | void on_btn_refuse_clicked(); 42 | 43 | private: 44 | Ui::ItemFriendApply *ui; 45 | }; 46 | 47 | #endif // ITEMFRIENDAPPLY_H 48 | -------------------------------------------------------------------------------- /Client-EChat/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "ui/uilogin.h" 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | QApplication a(argc, argv); 9 | a.setQuitOnLastWindowClosed(false);//设置最后窗口退出时候退出程序 10 | 11 | //创建共享内存块 12 | static QSharedMemory *EChat = new QSharedMemory("EChat"); 13 | if (!EChat->create(1)){//创建大小1b的内存 14 | qApp->quit(); //创建失败,说明已经有一个程序运行,退出当前程序 15 | return -1; 16 | } 17 | 18 | QFont font; 19 | font.setFamily("微软雅黑"); 20 | a.setFont(font); 21 | 22 | UiLogin w; 23 | w.show(); 24 | w.checkAutoLogin(); //检测自动登录 25 | 26 | return a.exec(); 27 | } 28 | -------------------------------------------------------------------------------- /Client-EChat/network/client.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENT_H 2 | #define CLIENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include "global.h" 23 | #include "thumbnail.h" 24 | 25 | #define SERVER_IP "81.68.113.233" // 服务器IP 26 | #define SERVER_PORT 7799 // 默认端口 27 | #define PACK_HEAD_LENGTH 4 28 | #define DATA_BOLCK_SIZE 1024 // 每个块的大小 29 | 30 | class Client : public QObject 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit Client(QObject *parent = nullptr); 36 | ~Client(); 37 | 38 | bool connectStatus() { return isConnecting; } 39 | 40 | signals: 41 | void connectState(bool bol); 42 | void fileSendFinish(const ChatObjInfo* info,const QString &fileName,const QString sql); 43 | 44 | // --服务器回应-- 45 | void loginReply(QByteArray json); 46 | void registerReply(QByteArray json); 47 | void resourceReply(QByteArray json); 48 | 49 | public slots: 50 | // void on_connected(); 51 | // void on_disconnected(); 52 | void on_stateChanged(QAbstractSocket::SocketState socketState); 53 | void on_readyRead(); 54 | 55 | void on_connectServer(); 56 | void on_disconnectClient(); 57 | 58 | // --处理客户端请求-- 59 | void on_newUserLogin(); 60 | void on_loginRequest(const int &userId, const QString &userPwd); // 101:验证用户 61 | void on_registerRequest(const QString &nickname, const QString &userPwd); // 102:注册用户 62 | void on_resourceRequest(const int &code, const int &frdId, const int &grpId,QJsonValue value); // code:资源请求 63 | 64 | void on_sendChatMsg(const QString &msg, const int &frd, const int &grp, const QString& sendTime); 65 | void on_sendChatFile(const ChatObjInfo* chatObjInfo,const QStringList &filePathList, const int &frd, const int &grp); 66 | // void on_sendChatImage(const QStringList &filePathList, const int &selfId, const int &frd, const int &grp); 67 | 68 | private: 69 | void send(const QByteArray &json); 70 | void HandleReply(const QByteArray &json); 71 | 72 | private: 73 | bool isConnecting; 74 | QTcpSocket *tcpSocket; 75 | QTimer *timer; // 76 | QByteArray buffer; 77 | int dataLen; 78 | 79 | }; 80 | 81 | #endif // CLIENT_H 82 | -------------------------------------------------------------------------------- /Client-EChat/qss/chat.qss: -------------------------------------------------------------------------------- 1 | 2 | 3 | #btn_emotion, 4 | #btn_image, 5 | #btn_file, 6 | #btn_screenshot, 7 | #btn_more{ 8 | background-color:rgb(245, 246, 247); 9 | border-top-right-radius:5px; 10 | } 11 | 12 | #btn_emotion:hover{ 13 | background-color:rgb(245, 246, 247); 14 | image:url(:/img/emo-clicked.png); 15 | } 16 | #btn_image:hover{ 17 | background-color:rgb(245, 246, 247); 18 | image:url(:/img/image-clicked.png); 19 | } 20 | #btn_file:hover{ 21 | background-color:rgb(245, 246, 247); 22 | image:url(:/img/folder-clicked.png); 23 | } 24 | #btn_screenshot:hover{ 25 | background-color:rgb(245, 246, 247); 26 | image:url(:/img/screenshot-clicked.png); 27 | } 28 | #btn_more:hover{ 29 | background-color:rgb(245, 246, 247); 30 | image:url(:/img/more-clicked.png); 31 | } 32 | 33 | #btn_emotion:pressed, 34 | #btn_emotion:pressed, 35 | #btn_file:pressed, 36 | #btn_screenshot:pressed, 37 | #btn_more:pressed{ 38 | background-color:rgb(245, 246, 247); 39 | } 40 | -------------------------------------------------------------------------------- /Client-EChat/qss/login.qss: -------------------------------------------------------------------------------- 1 | #widget_loginBackground{ 2 | background-color: rgb(255, 255, 255); 3 | border-radius:5px; 4 | } 5 | 6 | /*图标设置*/ 7 | #lab_icon{image:url(:/img/EChat.png);} 8 | #lab_accountImage{image:url(:/img/account.png);} 9 | #lab_pwdImage{image:url(:/img/password.png);} 10 | #btn_closeRegister{image:url(:/img/flod.png);} 11 | #btn_reflushNickName{image:url(:/img/refresh.png);} 12 | #btn_pwdIsOpen{image:url(:/img/pwdClose.png);} 13 | 14 | 15 | /*帮助按钮*/ 16 | /*关闭按钮*/ 17 | /*刷新昵称按钮*/ 18 | /*关闭注册按钮*/ 19 | /*显示密码按钮*/ 20 | /*前往注册按钮*/ 21 | #btn_help, 22 | #btn_closeRegister, 23 | #btn_reflushNickName, 24 | #btn_pwdIsOpen, 25 | #btn_goRegister, 26 | #btn_forgetPassword{ 27 | background-color:rgb(255,255,255); 28 | border-radius:0px; 29 | color:rgb(0,0,0); 30 | } 31 | #btn_help:hover, 32 | #btn_closeRegister:hover, 33 | #btn_reflushNickName:hover, 34 | #btn_pwdIsOpen:hover{ 35 | background-color:rgb(238,238,238); 36 | } 37 | 38 | #btn_help:pressed, 39 | #btn_closeRegister:pressed, 40 | #btn_reflushNickName:pressed, 41 | #btn_pwdIsOpen:pressed{ 42 | background-color:rgb(229, 229, 229); 43 | } 44 | 45 | /*关闭按钮*/ 46 | #btn_close{ 47 | background-color:rgb(255,255,255); 48 | color:rgb(0,0,0); 49 | /*border-radius:0px;*/ 50 | border-top-right-radius:5px; 51 | } 52 | #btn_close:hover{ 53 | background-color:rgb(248, 99, 95); 54 | color:rgb(255,255,255); 55 | } 56 | #btn_close:pressed{ 57 | background-color:rgb(240, 91, 87); 58 | } 59 | 60 | /*刷新昵称按钮圆角设置*/ 61 | /*显示密码按钮圆角设置*/ 62 | #btn_reflushNickName, 63 | #btn_pwdIsOpen{ 64 | border-radius:5px; 65 | /* border-top-right-radius:5px;*/ 66 | /* border-bottom-right-radius:5px;*/ 67 | } 68 | 69 | /*输入框*/ 70 | #line_loginPwd, 71 | #line_nickName, 72 | #line_registerPwd{ 73 | /*background-color: rgb(227,245,255);*/ 74 | background-color: rgb(255, 255, 255); 75 | border-radius:5px; 76 | border:2px solid gray; 77 | font: 10pt "Microsoft YaHei UI"; 78 | padding-left: 5px;/*左侧边距*/ 79 | } 80 | 81 | /*登录按钮*/ 82 | /*确认注册按钮*/ 83 | #btn_login, 84 | #btn_sureRegister{ 85 | background-color:rgb(245, 245, 245); 86 | border-radius:4px; 87 | border:1px solid gray; 88 | } 89 | #btn_login:hover, 90 | #btn_sureRegister:hover{ 91 | background-color:rgb(238,238,238); 92 | } 93 | #btn_login:pressed, 94 | #btn_sureRegister:pressed{ 95 | background-color:rgb(229, 229, 229); 96 | } 97 | 98 | /*注册按钮按下文字放大效果*/ 99 | #btn_goRegister:hover, 100 | #btn_forgetPassword:hover{font-weight:bold;} 101 | 102 | /*QCombobox组合框*/ 103 | #com_loginAccount{ 104 | border: 2px solid gray; 105 | border-radius: 5px; 106 | padding-left: 5px;/*左侧边距*/ 107 | } 108 | 109 | /*QCombobox右侧按钮*/ 110 | #com_loginAccount::drop-down { 111 | subcontrol-origin:padding; 112 | subcontrol-position:top right;/*放于右方顶部*/ 113 | width:30px;/*设置按钮范围宽度*/ 114 | border-radius:0px; 115 | } 116 | 117 | /*QCombobox右侧按钮的箭头图标*/ 118 | #com_loginAccount::down-arrow { 119 | border-image:url(:/img/comBoxFlod.png);/*自定义图片填充*/ 120 | width:30px; 121 | height:30px; 122 | } 123 | 124 | /* 下拉后,整个下拉窗体样式 */ 125 | #com_loginAccount QAbstractItemView { 126 | border: 2px solid gray;/*边框宽度、线形、颜色*/ 127 | background-color: rgb(255, 255, 255); 128 | padding:2px; 129 | /*border-bottom-left-radius:5px; 130 | border-bottom-right-radius:5px;*/ 131 | } 132 | -------------------------------------------------------------------------------- /Client-EChat/qss/style.qss: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Client-EChat/res.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/account.png 4 | img/EChat.png 5 | img/password.png 6 | img/refresh.png 7 | img/comBoxFlod.png 8 | img/flod.png 9 | img/pwdClose.png 10 | img/pwdOpen.png 11 | img/defaultPicture.ico 12 | img/testPicture.jpg 13 | img/lineLoading.gif 14 | img/threeLoading.gif 15 | img/folder-clicked.png 16 | img/folder-normal.png 17 | img/setting-clicked.png 18 | img/setting-normal.png 19 | img/msg-clicked.png 20 | img/msg-normal.png 21 | img/contact-clicked.png 22 | img/contact-normal.png 23 | img/emo-clicked.png 24 | img/emo-normal.png 25 | qss/chat.qss 26 | qss/home.qss 27 | qss/login.qss 28 | img/screenshot-clicked.png 29 | img/screenshot-normal.png 30 | img/arrow-left.png 31 | img/arrow-right.png 32 | img/more-clicked.png 33 | img/more-normal.png 34 | img/addContanct-hover.png 35 | img/folder-hover.png 36 | img/more-hover.png 37 | img/setting-hover.png 38 | img/contact-hover.png 39 | img/msg-hover.png 40 | img/addContanct-normal.png 41 | img/skypeLoader.gif 42 | img/ghost.gif 43 | img/switchLeft.png 44 | img/switchRight.png 45 | img/resetPwd.png 46 | img/EChat.ico 47 | img/file.png 48 | img/edit.png 49 | img/sure.png 50 | img/search.png 51 | img/head/1.png 52 | img/head/2.png 53 | img/head/3.png 54 | img/head/4.png 55 | img/head/5.png 56 | img/head/6.png 57 | img/head/7.png 58 | img/head/8.png 59 | img/head/9.png 60 | img/head/10.png 61 | img/head/11.png 62 | img/head/12.png 63 | img/head/1002.png 64 | img/head/1003.png 65 | img/head/1001.png 66 | img/head/13.png 67 | img/head/14.png 68 | img/head/15.png 69 | img/head/16.png 70 | img/head/17.png 71 | img/head/18.png 72 | img/head/19.png 73 | img/head/20.png 74 | img/head/21.png 75 | img/head/group.png 76 | img/head/person.png 77 | audio/simpeCuteAlert.wav 78 | img/image-clicked.png 79 | img/image-normal.png 80 | 81 | 82 | -------------------------------------------------------------------------------- /Client-EChat/thumbnail.h: -------------------------------------------------------------------------------- 1 | #ifndef THUMBNAIL_H 2 | #define THUMBNAIL_H 3 | 4 | #include "item/itemchatobject.h" 5 | #include "item/itemcontact.h" 6 | #include "ui/uichat.h" 7 | 8 | class ContactInfo 9 | { 10 | public: 11 | ContactInfo() : isSelect(false), item(nullptr){}; 12 | ~ContactInfo() 13 | { 14 | if (nullptr != item) { 15 | item->deleteLater(); 16 | item = nullptr; 17 | } 18 | }; 19 | bool isSelect; 20 | ItemContact *item; 21 | }; 22 | 23 | class ChatObjInfo 24 | { 25 | public: 26 | ChatObjInfo() : isSelect(false), isFrdId(false), isGrpId(false), item(nullptr), uiChat(nullptr){}; 27 | ~ChatObjInfo() 28 | { 29 | if (nullptr != item) { 30 | item->deleteLater(); 31 | item = nullptr; 32 | } 33 | if (nullptr != uiChat) { 34 | uiChat->deleteLater(); 35 | uiChat = nullptr; 36 | } 37 | }; 38 | bool isSelect; 39 | bool isFrdId; 40 | bool isGrpId; 41 | ItemChatObject *item; 42 | UiChat *uiChat; 43 | }; 44 | 45 | #endif // THUMBNAIL_H 46 | -------------------------------------------------------------------------------- /Client-EChat/ui/uichat.h: -------------------------------------------------------------------------------- 1 | #ifndef UICHAT_H 2 | #define UICHAT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include "db/database.h" 34 | #include "device/screenshot.h" 35 | #include "emo/emoji.h" 36 | 37 | #define UICHAT_MAX_SIZE QSize(1670, 962) // 最大窗口 38 | #define UICHAT_MIN_SIZE QSize(529, 473) // 最小窗口 39 | #define MAX_CONTENT_SHOW_HEIGHT 585 40 | #define MIN_CONTENT_SHOW_HEIGHT 255 41 | 42 | #define MSG_MARGIN_LEFT 150 43 | #define MSG_MARGIN_RIGHT 45 44 | #define MSG_DURATION_TIP 5 45 | 46 | #define IMAGE_WIDTH 300.0 47 | 48 | #define MSG_TEXT "text" 49 | #define MSG_FILE "file" 50 | #define MSG_IMAGE "image" 51 | 52 | namespace Ui { 53 | class UiChat; 54 | } 55 | 56 | class UiChat : public QWidget 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | explicit UiChat(QWidget *parent = nullptr); 62 | ~UiChat(); 63 | 64 | void setSidebarVisible(const bool &visible); 65 | void setSideNickname(const QString &nickname,const int& type); 66 | void setSideType(const int &type); 67 | void setInputFocus(); 68 | 69 | void setMemberType(const int&adminCount,const int &memberCount); 70 | void setGroupTopText(const QString &text); 71 | void addGroupMembers(const int &index, const QString &text,const QString &tip); 72 | void addFileMsg(const QString& fileName,const int& uerId); 73 | 74 | //文件发送提示 75 | void setFileNumTip(const int&count); 76 | void removeFileNumTip(); 77 | 78 | //离线消息加载 79 | void recvChatMsg(const int &type, const QJsonObject &msgObject); 80 | //本地数据加载 81 | void localChatMsg(const int &type,const QJsonObject &msgObject); 82 | //好友/群聊之间的数据接受 83 | void recvChatMsg(const QJsonObject &singleObject); 84 | 85 | void closeEmojiShow(); 86 | 87 | public: 88 | // bool event(QEvent *event) override; 89 | bool eventFilter(QObject *watched, QEvent *event) override; 90 | 91 | signals: 92 | void sendChatMsg(const QString &msg); 93 | void sendChatFile(QStringList &filePathList); 94 | 95 | public slots: 96 | void on_uiChatMax(const bool &state); 97 | 98 | private slots: 99 | void on_btn_send_clicked(); 100 | void on_btn_emotion_clicked(); 101 | void on_btn_image_clicked(); 102 | void on_btn_file_clicked(); 103 | void on_btn_screenshot_clicked(); 104 | void on_btn_more_clicked(); 105 | void on_btn_hideSlide_clicked(); 106 | 107 | private: 108 | QString getHeadPicture(const int type,int picture=0); 109 | 110 | void recvTimeTip(const QString &sendTime); //接受消息时间提示 111 | void sendTimeTip(); //发送消息时间提示 112 | void sendFileLoading(const bool&state); //发送文件加载提示 113 | 114 | //数据插入 115 | void insertHtml(const QString &html); 116 | void showSelfMsg(const int &type,const QString&nickname,const int &index,const QString &msg); 117 | void showSideMsg(const int &type,const QString&nickname,const int &index,const QString &msg); 118 | 119 | //消息图片提取 120 | QList getImageFromHtml(const QString& html); 121 | void saveImageFromMsg(const QString& msg); 122 | 123 | bool messageHasImage(const QString &msg); //检测消失是否还有图片 124 | 125 | private: 126 | int toolIndex;//用来提供插入 127 | QFont font; 128 | bool hideState; 129 | 130 | int sideType;//对方类型,好友/群聊 131 | 132 | QMovie *movie; 133 | Emoji *emoji; 134 | bool emojiShow; 135 | ScreenShot *screenshot; //截屏 136 | 137 | QDateTime lastRecvDateTime; 138 | QDateTime lastSendDateTime; 139 | 140 | private: 141 | Ui::UiChat *ui; 142 | }; 143 | 144 | #endif // UICHAT_H 145 | -------------------------------------------------------------------------------- /Client-EChat/ui/uihome.h: -------------------------------------------------------------------------------- 1 | #ifndef UIHOME_H 2 | #define UIHOME_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "global.h" 28 | #include "device/file.h" 29 | #include "db/database.h" 30 | #include "item/itemchatobject.h" 31 | #include "item/itemcontact.h" 32 | #include "item/itemfriendapply.h" 33 | #include "item/headpicture.h" 34 | #include "ui/uichat.h" 35 | #include "ui/uirely.h" 36 | 37 | namespace Ui { 38 | class UiHome; 39 | } 40 | 41 | class UiHome : public QWidget 42 | { 43 | Q_OBJECT 44 | 45 | public: 46 | explicit UiHome(QWidget *parent = nullptr); 47 | ~UiHome(); 48 | 49 | protected: 50 | void paintEvent(QPaintEvent *event) override; 51 | void mousePressEvent(QMouseEvent *event) override; 52 | void mouseReleaseEvent(QMouseEvent *event) override; 53 | void mouseMoveEvent(QMouseEvent *event) override; 54 | bool eventFilter(QObject *watched, QEvent *event) override; 55 | 56 | signals: 57 | void userExit(); 58 | void uiChatMax(const bool &state); 59 | void resourceRequest(const int &code, const int &frdId, const int &grpId,QJsonValue value); // 资源请求 60 | void sendChatMsg(const QString &msg, const int &frd, const int &grp, const QString& sendTime); // 发送消息 61 | void sendChatFile(const ChatObjInfo* chatObjInfo, const QStringList &filePathList, const int &frd, const int &grp); // 发送文件 62 | 63 | public slots: 64 | void on_setHeadPicture(const int index); 65 | void on_loginSuccess(); 66 | void on_fileSendFinish(const ChatObjInfo* chatObjInfo,const QString &fileName,const QString sql); 67 | void on_connectState(bool state); 68 | void on_sendChatMsg(const QString &msg); 69 | void on_sendChatFile(const QStringList &filePathList); 70 | void on_resourceReply(const QByteArray &json); // code资源请求回应处理--最后面 71 | 72 | private slots: 73 | //Home 74 | void on_btn_headPic_clicked(); 75 | void on_btn_message_clicked(); 76 | void on_btn_contact_clicked(); 77 | void on_btn_file_clicked(); 78 | void on_btn_config_clicked(); 79 | void on_btn_more_clicked(); 80 | 81 | //Home-联系人类型 82 | void on_btn_friend_clicked(); 83 | void on_btn_group_clicked(); 84 | 85 | //Home-添加好友/群 86 | void on_btn_seek_clicked(); 87 | void on_btn_add_clicked(); 88 | void on_btn_addGroupPicture_clicked(); 89 | void on_btn_sureAddGourp_clicked(); 90 | void on_btn_cancelAddGroup_clicked(); 91 | 92 | //Home-个人信息界面 93 | void on_btn_deleteContact_clicked(); 94 | void on_btn_edit_clicked(); 95 | void on_btn_editPicture_clicked(); 96 | void on_btn_sendMsg_clicked(); 97 | 98 | //Home-群聊信息界面 99 | void on_btn_quitGroup_clicked(); 100 | void on_btn_grpEdit_clicked(); 101 | void on_btn_grpEditMyName_clicked(); 102 | void on_btn_editGrpPicture_clicked(); 103 | void on_btn_grpSendMsg_clicked(); 104 | 105 | //Home-文件管理界面 106 | void on_btn_openFilePos_clicked(); 107 | void on_btn_openScreenShotPos_clicked(); 108 | void on_btn_allFile_clicked(); 109 | void on_btn_friendFile_clicked(); 110 | void on_btn_groupFile_clicked(); 111 | 112 | //Home-设置界面 113 | void on_btn_exitLogin_clicked(); 114 | void on_btn_autoLogin_clicked(); 115 | void on_btn_remainPwd_clicked(); 116 | void on_btn_newNotifyVoice_clicked(); 117 | void on_btn_groupNotifyVoice_clicked(); 118 | void on_btn_selectNewPath_clicked(); 119 | void on_btn_autoUpdate_clicked(); 120 | void on_btn_surePasswordModify_clicked(); 121 | void on_btn_resetPassword_clicked(); 122 | 123 | void on_btn_submitSuggest_clicked(); 124 | 125 | 126 | private: 127 | void initLocalMsg(const ChatObjInfo *info,const int& chatObjId); //加载本地数据 128 | void initNeedRequest(); //请求资源 129 | void initFileList(); //初始化文件 130 | void initBaseContact();//联系人基础控件 131 | void createFileToolButton(const QString &fileName,const QString &text,const QString &filePath,const QString &tip); 132 | ChatObjInfo* createChatObject(const int &id,const int &type); 133 | void clearSeekInfo(); 134 | void clearFriendInfo(); 135 | void clearGroupInfo(bool isAll = true); 136 | void clearCreateGroupInfo(); 137 | void clearFiles(); 138 | void clearModifyPassword(); 139 | void clearAllData(); 140 | void closeHeadPicture(); 141 | void deleteFriend(const int &friendId); //删除好友 142 | void quitGroup(const int&groupId); 143 | QString getHeadPicture(const int type,int picture=0); 144 | void newMessageTip(const int &type); //新消息提示 145 | bool messageHasImage(const QString &msg); //检测消失是否还有图片 146 | void setInputRegExp(); //正则表达式 147 | void dockIconChanged(const int &index); //dock栏按钮操作 148 | void buttonExclusive(ButtonType buttonType, void *item); //联系人按钮操作 149 | void connectChatObject(ItemChatObject* item,UiChat* uiChat);//聊天对象信号槽连接 150 | void contactCliked(ClikedType clikedType,ItemContact* item); //联系人按钮点击事件 151 | 152 | private: 153 | QPoint offset; 154 | bool isDrag; 155 | // bool isTop; // 窗口置顶状态,默认不置顶 156 | QTimer *updateTimer; 157 | QMovie *movie; 158 | int createGroupPicture; 159 | 160 | QMap chatObjects; 161 | QMap friends; // 0 - 3始终被占用 162 | QMap applicants; 163 | QMap groups; //0 始终被占用 164 | QMap groupsMems; //群消息展示,群成员 165 | QMap selectGrpMems; 166 | QMap files; //文件 167 | 168 | //按键状态 169 | QMap dock; 170 | bool editingSelfInfo; 171 | bool editingGrpInfo; 172 | bool editingMyGrpName; 173 | 174 | DataBase* db; 175 | File *file; 176 | HeadPicture *headPicture; 177 | bool selectingPicture; 178 | 179 | 180 | private: 181 | Ui::UiHome *ui; 182 | }; 183 | 184 | #endif // UIHome_H 185 | -------------------------------------------------------------------------------- /Client-EChat/ui/uilogin.h: -------------------------------------------------------------------------------- 1 | #ifndef UILOGIN_H 2 | #define UILOGIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "network/client.h" 25 | #include "device/file.h" 26 | #include "ui/uihome.h" 27 | #include "global.h" 28 | 29 | #define LOGIN_TIP_COUNT 8 30 | 31 | namespace Ui { 32 | class UiLogin; 33 | } 34 | 35 | class UiLogin : public QMainWindow 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | UiLogin(QWidget *parent = nullptr); 41 | ~UiLogin(); 42 | void checkAutoLogin(); 43 | 44 | protected: 45 | void paintEvent(QPaintEvent *event) override; 46 | void mousePressEvent(QMouseEvent *event) override; 47 | void mouseReleaseEvent(QMouseEvent *event) override; 48 | void mouseMoveEvent(QMouseEvent *event) override; 49 | bool eventFilter(QObject *watched, QEvent *event) override; 50 | // void closeEvent(QCloseEvent *event) override; 51 | 52 | signals: 53 | void connectServer(); 54 | void uiLoginClose(); 55 | void allowUiClose(); // 资源释放 56 | void newUserLogin(); 57 | void loginSuccess(); 58 | 59 | // --客户端请求-- 60 | void loginRequest(const int &userId, const QString &userPwd); 61 | void registerRequest(const QString &nickname, const QString &newNpwd); 62 | 63 | public slots: 64 | void on_connectState(bool state); 65 | 66 | // --处理服务器回应-- 67 | void on_loginReply(QByteArray json); // 101:验证用户 68 | void on_registerReply(QByteArray json); // 102:注册用户 69 | 70 | private slots: 71 | void on_loginTip(); 72 | void on_userExit(); 73 | void on_btn_reflushNickName_clicked(); // 随机昵称-√ 74 | void on_btn_pwdIsOpen_clicked(); // 显隐密码-√ 75 | void on_btn_login_clicked(); // 登录账户-√ 76 | void on_btn_sureRegister_clicked(); // 注册账户-√ 77 | void on_btn_close_clicked(); // 关闭窗口-√ 78 | void on_btn_forgetPassword_clicked(); //忘记密码 79 | 80 | private: 81 | void setInputRegExp(); 82 | void setVertifyCode(); 83 | void clearRegisterInfo(); 84 | void createystemTrayIcon(); 85 | void addNickNameMap(); 86 | 87 | private: 88 | QPoint offset; // 89 | int offy; // 90 | bool isDrag; 91 | QMovie *movie; 92 | int loginTipNum; 93 | QTimer* timer; 94 | bool userLoginFlag; //系统托盘点击显示界面判断标志 95 | 96 | int verifyResult; // 验证计算结果 97 | bool pwdIsOpen; // 密码是否可见,默认不可见 98 | QMap nickNameMap; // 昵称 99 | 100 | File *file; 101 | UiHome *uiHome; // 主界面ui 102 | // QSharedPointer uiHome; 103 | 104 | private: 105 | Ui::UiLogin *ui; 106 | }; 107 | #endif // UILogin_H 108 | -------------------------------------------------------------------------------- /Client-EChat/ui/uirely.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "uirely.h" 3 | 4 | int lastDockIndex; //用于dock栏点击&恢复显示,默认消息被点击 5 | 6 | int currChatObjectID; 7 | 8 | int contactType;//0-好友界面(默认) 1-群聊界面 9 | 10 | const int defaultPage = 0; 11 | int friendOpPage; // 1 2 4 默认第0页 12 | int groupOpPage;// 3 5 默认第0页 13 | 14 | ChatObjInfo *currChatObjInfo = nullptr; //当前聊天对象 15 | 16 | // 2.3联系人页面项对应的EC号 17 | int currContactFrdID; 18 | int currContactGrpID; 19 | 20 | 21 | -------------------------------------------------------------------------------- /Client-EChat/ui/uirely.h: -------------------------------------------------------------------------------- 1 | #ifndef UIRELY_H 2 | #define UIRELY_H 3 | 4 | #include "thumbnail.h" 5 | 6 | enum class MsgType{ 7 | Text, 8 | File, 9 | Image 10 | }; 11 | 12 | enum class ClikedType{ 13 | FriendApply, 14 | AddContact, 15 | Self, 16 | AddGroup, 17 | Friend, 18 | Group, 19 | ChatObject 20 | }; 21 | 22 | enum class ButtonType{ 23 | Friend, 24 | Group, 25 | ChatObject 26 | }; 27 | 28 | #define FRIEND 0 29 | #define GROUP 1 30 | 31 | //////////////总体四大界面 ////////////// 32 | #define PAGE_HOME_MSG 0 33 | #define PAGE_HOME_CONTACT 1 34 | #define PAGE_HOME_FILE 2 35 | #define PAGE_HOME_CONFIG 3 36 | #define PAGE_HOME_MORE 4 37 | 38 | extern int lastDockIndex; //用于dock栏点击&恢复显示 39 | 40 | ////////////// 1.消息界面 ////////////// 41 | #define PAGE_HOME_MSG_DEFAULT 0 // 默认界界面 42 | extern int currChatObjectID; 43 | 44 | ////////////// 2.联系人界面 ////////////// 45 | // 2.1联系人操作类型界面 46 | #define PAGE_CONTACT_TYPE_FRIEND 0 47 | #define PAGE_CONTACT_TYPE_GROUP 1 48 | 49 | extern int contactType;//0-好友界面 1-群聊界面 50 | 51 | // 2.2 联系人界面中的具体页面 52 | #define PAGE_CONTACT_OP_DEFAULT 0 // 默认界界面 (公) 53 | #define PAGE_CONTACT_OP_FRIEND_APPLY 1 //1 - 好友申请(好友) 54 | #define PAGE_CONTACT_OP_ADD_CONTACT 2 //2 - 添加好友(好友) 55 | #define PAGE_CONTACT_OP_CREATE_GROUP 3 //3 - 创建群 (群聊) 56 | #define PAGE_CONTACT_OP_FRIEND_INFO 4 //4 - 用户信息 (好友) 57 | #define PAGE_CONTACT_OP_GROUP_INFO 5 // 5 - 群信息 (群聊) 58 | 59 | //////// 3.文件管理 //////// 60 | #define PAGE_FILE_ALL 0 61 | #define PAGE_FILE_FRIEND 1 62 | #define PAGE_FILE_GROUP 2 63 | 64 | extern const int defaultPage; 65 | extern int friendOpPage; // 1 2 4 66 | extern int groupOpPage;// 3 5 67 | 68 | extern ChatObjInfo *currChatObjInfo; //当前聊天对象 69 | 70 | // 2.3联系人页面项对应的EC号 71 | extern int currContactFrdID; 72 | extern int currContactGrpID; 73 | 74 | #define LINE_EDIT_START QString("QLineEdit{background-color: rgb(255, 255, 255);border-radius:5px;border:1px solid gray;padding-left:5px;}") 75 | #define LINE_EDIT_FINISH QString("QLineEdit{background-color: rgb(245, 246, 247);border:none;padding-left: 5px;}") 76 | 77 | 78 | #endif // UIRELY_H 79 | 80 | -------------------------------------------------------------------------------- /DB/客户端SQLite(仅结构).sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat Premium Data Transfer 3 | 4 | Source Server : ChatMsg 5 | Source Server Type : SQLite 6 | Source Server Version : 3030001 7 | Source Schema : main 8 | 9 | Target Server Type : SQLite 10 | Target Server Version : 3030001 11 | File Encoding : 65001 12 | 13 | Date: 04/06/2023 17:17:59 14 | */ 15 | 16 | PRAGMA foreign_keys = false; 17 | 18 | -- ---------------------------- 19 | -- Table structure for ec_messages 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS "ec_messages"; 22 | CREATE TABLE "ec_messages" ( 23 | "id" INTEGER PRIMARY KEY AUTOINCREMENT, 24 | "sender" int NOT NULL, 25 | "senderPicture" int DEFAULT NULL, 26 | "frd_id" int DEFAULT NULL, 27 | "grp_id" int DEFAULT NULL, 28 | "type" tinyint(4) NOT NULL, 29 | "message" longtext DEFAULT NULL, 30 | "msg_type" varchar(50) NOT NULL, 31 | "send_time" timestamp NOT NULL DEFAULT CURRENT_timestamp, 32 | "file_name" varchar(255) DEFAULT NULL, 33 | "suffix" varchar(20) DEFAULT NULL, 34 | "file_path" text DEFAULT NULL 35 | ); 36 | 37 | -- ---------------------------- 38 | -- Table structure for ec_users 39 | -- ---------------------------- 40 | DROP TABLE IF EXISTS "ec_users"; 41 | CREATE TABLE "ec_users" ( 42 | "id" INTEGER PRIMARY KEY AUTOINCREMENT, 43 | "usr_id" int NOT NULL, 44 | "usr_type" tinyint(4) NOT NULL, 45 | "usr_nickname" int DEFAULT NULL, 46 | "usr_picture" int DEFAULT NULL 47 | ); 48 | 49 | -- ---------------------------- 50 | -- Table structure for sqlite_sequence 51 | -- ---------------------------- 52 | DROP TABLE IF EXISTS "sqlite_sequence"; 53 | CREATE TABLE "sqlite_sequence" ( 54 | "name" , 55 | "seq" 56 | ); 57 | 58 | -- ---------------------------- 59 | -- Auto increment value for ec_messages 60 | -- ---------------------------- 61 | UPDATE "sqlite_sequence" SET seq = 554 WHERE name = 'ec_messages'; 62 | 63 | -- ---------------------------- 64 | -- Auto increment value for ec_users 65 | -- ---------------------------- 66 | UPDATE "sqlite_sequence" SET seq = 43 WHERE name = 'ec_users'; 67 | 68 | PRAGMA foreign_keys = true; 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 此版本是原始版本,客户端是Qt5.15.2,服务器是centos7。 2 | 3 | Qt6版本地址(有时间持续更新代码|优化代码|重构代码|重写代码...):https://github.com/swansfought/EChat-Qt6 4 | 5 | --- 6 | - [EChat概述](#echat--) 7 | * [应用技术](#----) 8 | * [代码结构](#----) 9 | * [重点待改进点](#----) 10 | - [功能模块(图片形式展示)](#------------) 11 | * [1. 登录注册模块](#1-------) 12 | * [2.消息收发模块](#2------) 13 | * [3.联系人管理模块](#3-------) 14 | * [4.文件管理模块](#4------) 15 | * [5.用户配置模块](#5------) 16 | * [6.用户反馈模块](#6------) 17 | - [部分截图](#----) 18 | * [系统登录界面效果图](#---------) 19 | * [好友消息收发界面效果图](#-----------) 20 | * [好友申请列表效果图](#---------) 21 | * [个人和好友信息展示效果图](#------------) 22 | * [发送图片效果图](#-------) 23 | * [创建群聊效果图](#-------) 24 | * [用户配置界面图](#-------) 25 | 26 | ## EChat概述 27 | ​ Qt即时通讯软件EChat(Qt版本是5.15.2)。23年大四下毕业设计,本项目主要提供稳定且支持多平台的通讯软件,以提升用户体验。至于代码方面也存在很多问题的,很多其实需要重写和优化的。 28 | 29 | ### 应用技术 30 | Linux 、 C/C++ 、 QT 、 Socket 、 epoll 、 CMake 、 QSS 、 JSON 、jsoncpp 、 HTML 、 MySQL 、 SQLite 。 31 | 32 | ### 代码结构 33 | 服务器代码:epoll+多线程实现高并发,数据存储使用MySQL 34 | 35 | 客户端代码:qt编写,数据本地存储使用SQLite 36 | 37 | ### 重点待改进点 38 | 列举服务器的一些主要问题,客户端的以及服务器其他的问题可以自行进行完善和补充哈! 39 | 40 | 1、多线程方面:使用线程池去管理线程的创建和销毁,提高服务器处理效率; 41 | 42 | 2、内存管理方面:对于请求报文(json)这种大小相对固定的数据不必每次读取申请内存,一定程度上有助于提高服务器处理效率; 43 | 44 | 3、文件收发方面:先说结论,正常都是支持10M以内的文件收发,10M以上的服务器端的程序容易崩。文件就txt,图片应该都是可以的,主要是像docx、pdf和zip等这些编码没研究明白。至于程序崩溃了怎么办,我这里恰好这里采用了systemd去管理服务端程序,一定程度上缓解了此问题🥲。 45 | 46 | 4、数据安全方面:消息收发都是明文发的哈,没有使用加密机制(如SSL)去确保消息的私密性;用户密码方面数据库中使用MD5加密,本地如果勾选保存密码,则采用的是字符密钥加密算法存储在配置文件中。 47 | 48 | ## 功能模块(图片形式展示) 49 | 50 | ### 1. 登录注册模块 51 | 52 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/md/%E7%99%BB%E5%BD%95%E6%B3%A8%E5%86%8C%E6%A8%A1%E5%9D%97%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B%E5%9B%BE.png) 53 | 54 | 55 | ### 2.消息收发模块 56 | 57 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/md/%E6%B6%88%E6%81%AF%E6%94%B6%E5%8F%91%E5%8A%9F%E8%83%BD%E6%A8%A1%E5%9D%97%E5%9B%BE.png) 58 | 59 | 60 | ### 3.联系人管理模块 61 | 62 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/md/%E8%81%94%E7%B3%BB%E4%BA%BA%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E5%9B%BE.png) 63 | 64 | 65 | ### 4.文件管理模块 66 | 67 | 只列出已实现的 68 | 69 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/md/%E6%96%87%E4%BB%B6%E7%AE%A1%E7%90%86%E6%A8%A1%E5%9D%97%E5%9B%BE.png) 70 | 71 | 72 | ### 5.用户配置模块 73 | 74 | 只列出已实现的 75 | 76 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/md/%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE%E5%8A%9F%E8%83%BD%E6%A8%A1%E5%9D%97%E5%9B%BE(%E5%9B%BE%E4%B8%AD%E4%B8%BA%E5%B7%B2%E5%AE%9E%E7%8E%B0%E7%9A%84).png) 77 | 78 | 79 | ### 6.用户反馈模块 80 | 81 | 82 | ## 部分截图 83 | ### 系统登录界面效果图 84 | 85 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E7%B3%BB%E7%BB%9F%E7%99%BB%E5%BD%95%E7%95%8C%E9%9D%A2%E6%95%88%E6%9E%9C%E5%9B%BE.png) 86 | 87 | 88 | ### 好友消息收发界面效果图 89 | 90 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E5%A5%BD%E5%8F%8B%E6%B6%88%E6%81%AF%E6%94%B6%E5%8F%91%E7%95%8C%E9%9D%A2%E6%95%88%E6%9E%9C%E5%9B%BE.png) 91 | 92 | 93 | ### 好友申请列表效果图 94 | 95 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E5%A5%BD%E5%8F%8B%E7%94%B3%E8%AF%B7%E5%88%97%E8%A1%A8%E6%95%88%E6%9E%9C%E5%9B%BE.png) 96 | 97 | 98 | ### 个人和好友信息展示效果图 99 | 100 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E4%B8%AA%E4%BA%BA%E5%92%8C%E5%A5%BD%E5%8F%8B%E4%BF%A1%E6%81%AF%E5%B1%95%E7%A4%BA%E6%95%88%E6%9E%9C%E5%9B%BE.png) 101 | 102 | 103 | ### 发送图片效果图 104 | 105 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E5%8F%91%E9%80%81%E5%9B%BE%E7%89%87%E6%95%88%E6%9E%9C%E5%9B%BE.png) 106 | 107 | 108 | ### 创建群聊效果图 109 | 110 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E5%88%9B%E5%BB%BA%E7%BE%A4%E8%81%8A%E6%95%88%E6%9E%9C%E5%9B%BE.png) 111 | 112 | 113 | ### 用户配置界面图 114 | 115 | ![image](https://github.com/swansfought/EChat/blob/main/%E9%83%A8%E5%88%86%E6%88%AA%E5%9B%BE/%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE%E7%95%8C%E9%9D%A2%E5%9B%BE.png) 116 | 117 | 118 | -------------------------------------------------------------------------------- /Server-EChat/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "defines": [], 9 | "compilerPath": "/usr/bin/g++", 10 | "cStandard": "c11", 11 | "cppStandard": "c++14", 12 | "intelliSenseMode": "linux-gcc-x64", 13 | "configurationProvider": "ms-vscode.cmake-tools" 14 | } 15 | ], 16 | "version": 4 17 | } -------------------------------------------------------------------------------- /Server-EChat/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "stdlib.h": "c", 4 | "inet.h": "c", 5 | "in.h": "c", 6 | "features.h": "c", 7 | "pthread.h": "c", 8 | "pthreadtypes.h": "c", 9 | "socket.h": "c", 10 | "errno.h": "c", 11 | "epoll.h": "c", 12 | "unistd.h": "c", 13 | "ostream": "cpp", 14 | "*.tcc": "cpp", 15 | "cctype": "cpp", 16 | "clocale": "cpp", 17 | "cmath": "cpp", 18 | "cstdarg": "cpp", 19 | "cstdint": "cpp", 20 | "cstdio": "cpp", 21 | "cstdlib": "cpp", 22 | "cwchar": "cpp", 23 | "cwctype": "cpp", 24 | "exception": "cpp", 25 | "initializer_list": "cpp", 26 | "iosfwd": "cpp", 27 | "iostream": "cpp", 28 | "istream": "cpp", 29 | "limits": "cpp", 30 | "new": "cpp", 31 | "streambuf": "cpp", 32 | "type_traits": "cpp", 33 | "typeinfo": "cpp", 34 | "string": "cpp", 35 | "ctype.h": "c", 36 | "types.h": "c", 37 | "stdio.h": "c", 38 | "functional": "cpp", 39 | "ratio": "cpp", 40 | "tuple": "cpp", 41 | "array": "cpp", 42 | "cstring": "cpp", 43 | "system_error": "cpp", 44 | "utility": "cpp", 45 | "mutex": "cpp", 46 | "bitset": "cpp", 47 | "fstream": "cpp", 48 | "sstream": "cpp", 49 | "stdexcept": "cpp", 50 | "chrono": "cpp", 51 | "ctime": "cpp", 52 | "deque": "cpp", 53 | "unordered_map": "cpp", 54 | "vector": "cpp", 55 | "numeric": "cpp", 56 | "cinttypes": "cpp", 57 | "regex": "cpp", 58 | "algorithm": "cpp", 59 | "iterator": "cpp", 60 | "memory": "cpp", 61 | "thread": "cpp", 62 | "random": "cpp", 63 | "list": "cpp" 64 | }, 65 | "editor.fontSize": 14 66 | } -------------------------------------------------------------------------------- /Server-EChat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0) 2 | 3 | project(EChat) 4 | 5 | # add_definitions("") 6 | link_directories(/usr/local/lib) 7 | link_directories(/usr/lib64/mysql) 8 | 9 | # set(CMAKE_BUILD_TYPE Release) 10 | set(CMAKE_CXX_STANDARD 11) 11 | # set(CMAKE_CXX_FLAGS "-std=c++11 -O1") 12 | 13 | include_directories(include) 14 | 15 | add_subdirectory(src) 16 | 17 | add_executable(EChat main.cpp) 18 | 19 | target_link_libraries(EChat echatlib) 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CMakeCCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "/usr/bin/cc") 2 | set(CMAKE_C_COMPILER_ARG1 "") 3 | set(CMAKE_C_COMPILER_ID "GNU") 4 | set(CMAKE_C_COMPILER_VERSION "11.4.0") 5 | set(CMAKE_C_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_C_COMPILER_WRAPPER "") 7 | set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") 8 | set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") 9 | set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") 10 | set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") 11 | set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") 12 | set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") 13 | set(CMAKE_C17_COMPILE_FEATURES "c_std_17") 14 | set(CMAKE_C23_COMPILE_FEATURES "c_std_23") 15 | 16 | set(CMAKE_C_PLATFORM_ID "Linux") 17 | set(CMAKE_C_SIMULATE_ID "") 18 | set(CMAKE_C_COMPILER_FRONTEND_VARIANT "") 19 | set(CMAKE_C_SIMULATE_VERSION "") 20 | 21 | 22 | 23 | 24 | set(CMAKE_AR "/usr/bin/ar") 25 | set(CMAKE_C_COMPILER_AR "/usr/bin/gcc-ar-11") 26 | set(CMAKE_RANLIB "/usr/bin/ranlib") 27 | set(CMAKE_C_COMPILER_RANLIB "/usr/bin/gcc-ranlib-11") 28 | set(CMAKE_LINKER "/usr/bin/ld") 29 | set(CMAKE_MT "") 30 | set(CMAKE_COMPILER_IS_GNUCC 1) 31 | set(CMAKE_C_COMPILER_LOADED 1) 32 | set(CMAKE_C_COMPILER_WORKS TRUE) 33 | set(CMAKE_C_ABI_COMPILED TRUE) 34 | 35 | set(CMAKE_C_COMPILER_ENV_VAR "CC") 36 | 37 | set(CMAKE_C_COMPILER_ID_RUN 1) 38 | set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) 39 | set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) 40 | set(CMAKE_C_LINKER_PREFERENCE 10) 41 | 42 | # Save compiler ABI information. 43 | set(CMAKE_C_SIZEOF_DATA_PTR "8") 44 | set(CMAKE_C_COMPILER_ABI "ELF") 45 | set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") 46 | set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 47 | 48 | if(CMAKE_C_SIZEOF_DATA_PTR) 49 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") 50 | endif() 51 | 52 | if(CMAKE_C_COMPILER_ABI) 53 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") 54 | endif() 55 | 56 | if(CMAKE_C_LIBRARY_ARCHITECTURE) 57 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 58 | endif() 59 | 60 | set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") 61 | if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) 62 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") 63 | endif() 64 | 65 | 66 | 67 | 68 | 69 | set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/11/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 70 | set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;gcc_s;c;gcc;gcc_s") 71 | set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/11;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 72 | set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 73 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CMakeCXXCompiler.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_CXX_COMPILER "/usr/bin/c++") 2 | set(CMAKE_CXX_COMPILER_ARG1 "") 3 | set(CMAKE_CXX_COMPILER_ID "GNU") 4 | set(CMAKE_CXX_COMPILER_VERSION "11.4.0") 5 | set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") 6 | set(CMAKE_CXX_COMPILER_WRAPPER "") 7 | set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17") 8 | set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") 9 | set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") 10 | set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") 11 | set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") 12 | set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") 13 | set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") 14 | set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") 15 | set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") 16 | 17 | set(CMAKE_CXX_PLATFORM_ID "Linux") 18 | set(CMAKE_CXX_SIMULATE_ID "") 19 | set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") 20 | set(CMAKE_CXX_SIMULATE_VERSION "") 21 | 22 | 23 | 24 | 25 | set(CMAKE_AR "/usr/bin/ar") 26 | set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-11") 27 | set(CMAKE_RANLIB "/usr/bin/ranlib") 28 | set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-11") 29 | set(CMAKE_LINKER "/usr/bin/ld") 30 | set(CMAKE_MT "") 31 | set(CMAKE_COMPILER_IS_GNUCXX 1) 32 | set(CMAKE_CXX_COMPILER_LOADED 1) 33 | set(CMAKE_CXX_COMPILER_WORKS TRUE) 34 | set(CMAKE_CXX_ABI_COMPILED TRUE) 35 | 36 | set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") 37 | 38 | set(CMAKE_CXX_COMPILER_ID_RUN 1) 39 | set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm) 40 | set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) 41 | 42 | foreach (lang C OBJC OBJCXX) 43 | if (CMAKE_${lang}_COMPILER_ID_RUN) 44 | foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) 45 | list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) 46 | endforeach() 47 | endif() 48 | endforeach() 49 | 50 | set(CMAKE_CXX_LINKER_PREFERENCE 30) 51 | set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) 52 | 53 | # Save compiler ABI information. 54 | set(CMAKE_CXX_SIZEOF_DATA_PTR "8") 55 | set(CMAKE_CXX_COMPILER_ABI "ELF") 56 | set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") 57 | set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 58 | 59 | if(CMAKE_CXX_SIZEOF_DATA_PTR) 60 | set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") 61 | endif() 62 | 63 | if(CMAKE_CXX_COMPILER_ABI) 64 | set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") 65 | endif() 66 | 67 | if(CMAKE_CXX_LIBRARY_ARCHITECTURE) 68 | set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") 69 | endif() 70 | 71 | set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") 72 | if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) 73 | set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") 74 | endif() 75 | 76 | 77 | 78 | 79 | 80 | set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/11;/usr/include/x86_64-linux-gnu/c++/11;/usr/include/c++/11/backward;/usr/lib/gcc/x86_64-linux-gnu/11/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") 81 | set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") 82 | set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/11;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") 83 | set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") 84 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_C.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_C.bin -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_CXX.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/CMakeFiles/3.22.1/CMakeDetermineCompilerABI_CXX.bin -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CMakeSystem.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_HOST_SYSTEM "Linux-5.15.0-88-generic") 2 | set(CMAKE_HOST_SYSTEM_NAME "Linux") 3 | set(CMAKE_HOST_SYSTEM_VERSION "5.15.0-88-generic") 4 | set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") 5 | 6 | 7 | 8 | set(CMAKE_SYSTEM "Linux-5.15.0-88-generic") 9 | set(CMAKE_SYSTEM_NAME "Linux") 10 | set(CMAKE_SYSTEM_VERSION "5.15.0-88-generic") 11 | set(CMAKE_SYSTEM_PROCESSOR "x86_64") 12 | 13 | set(CMAKE_CROSSCOMPILING "FALSE") 14 | 15 | set(CMAKE_SYSTEM_LOADED 1) 16 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CompilerIdC/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/CMakeFiles/3.22.1/CompilerIdC/a.out -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/3.22.1/CompilerIdCXX/a.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/CMakeFiles/3.22.1/CompilerIdCXX/a.out -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/nb/EChat") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/nb/EChat/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Consider dependencies only in project. 3 | set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) 4 | 5 | # The set of languages for which implicit dependencies are needed: 6 | set(CMAKE_DEPENDS_LANGUAGES 7 | ) 8 | 9 | # The set of dependency files which are needed: 10 | set(CMAKE_DEPENDS_DEPENDENCY_FILES 11 | "/home/nb/EChat/main.cpp" "CMakeFiles/EChat.dir/main.cpp.o" "gcc" "CMakeFiles/EChat.dir/main.cpp.o.d" 12 | ) 13 | 14 | # Targets to which this target links. 15 | set(CMAKE_TARGET_LINKED_INFO_FILES 16 | "/home/nb/EChat/build/src/CMakeFiles/echatlib.dir/DependInfo.cmake" 17 | ) 18 | 19 | # Fortran module output directory. 20 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 21 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | #============================================================================= 8 | # Special targets provided by cmake. 9 | 10 | # Disable implicit rules so canonical targets will work. 11 | .SUFFIXES: 12 | 13 | # Disable VCS-based implicit rules. 14 | % : %,v 15 | 16 | # Disable VCS-based implicit rules. 17 | % : RCS/% 18 | 19 | # Disable VCS-based implicit rules. 20 | % : RCS/%,v 21 | 22 | # Disable VCS-based implicit rules. 23 | % : SCCS/s.% 24 | 25 | # Disable VCS-based implicit rules. 26 | % : s.% 27 | 28 | .SUFFIXES: .hpux_make_needs_suffix_list 29 | 30 | # Command-line flag to silence nested $(MAKE). 31 | $(VERBOSE)MAKESILENT = -s 32 | 33 | #Suppress display of executed commands. 34 | $(VERBOSE).SILENT: 35 | 36 | # A target that is always out of date. 37 | cmake_force: 38 | .PHONY : cmake_force 39 | 40 | #============================================================================= 41 | # Set environment variables for the build. 42 | 43 | # The shell in which to execute make rules. 44 | SHELL = /bin/sh 45 | 46 | # The CMake executable. 47 | CMAKE_COMMAND = /usr/bin/cmake 48 | 49 | # The command to remove a file. 50 | RM = /usr/bin/cmake -E rm -f 51 | 52 | # Escaping for special characters. 53 | EQUALS = = 54 | 55 | # The top-level source directory on which CMake was run. 56 | CMAKE_SOURCE_DIR = /home/nb/EChat 57 | 58 | # The top-level build directory on which CMake was run. 59 | CMAKE_BINARY_DIR = /home/nb/EChat/build 60 | 61 | # Include any dependencies generated for this target. 62 | include CMakeFiles/EChat.dir/depend.make 63 | # Include any dependencies generated by the compiler for this target. 64 | include CMakeFiles/EChat.dir/compiler_depend.make 65 | 66 | # Include the progress variables for this target. 67 | include CMakeFiles/EChat.dir/progress.make 68 | 69 | # Include the compile flags for this target's objects. 70 | include CMakeFiles/EChat.dir/flags.make 71 | 72 | CMakeFiles/EChat.dir/main.cpp.o: CMakeFiles/EChat.dir/flags.make 73 | CMakeFiles/EChat.dir/main.cpp.o: ../main.cpp 74 | CMakeFiles/EChat.dir/main.cpp.o: CMakeFiles/EChat.dir/compiler_depend.ts 75 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/EChat.dir/main.cpp.o" 76 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/EChat.dir/main.cpp.o -MF CMakeFiles/EChat.dir/main.cpp.o.d -o CMakeFiles/EChat.dir/main.cpp.o -c /home/nb/EChat/main.cpp 77 | 78 | CMakeFiles/EChat.dir/main.cpp.i: cmake_force 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/EChat.dir/main.cpp.i" 80 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/nb/EChat/main.cpp > CMakeFiles/EChat.dir/main.cpp.i 81 | 82 | CMakeFiles/EChat.dir/main.cpp.s: cmake_force 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/EChat.dir/main.cpp.s" 84 | /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/nb/EChat/main.cpp -o CMakeFiles/EChat.dir/main.cpp.s 85 | 86 | # Object files for target EChat 87 | EChat_OBJECTS = \ 88 | "CMakeFiles/EChat.dir/main.cpp.o" 89 | 90 | # External object files for target EChat 91 | EChat_EXTERNAL_OBJECTS = 92 | 93 | EChat: CMakeFiles/EChat.dir/main.cpp.o 94 | EChat: CMakeFiles/EChat.dir/build.make 95 | EChat: src/libechatlib.a 96 | EChat: ../lib/libjsoncpp.a 97 | EChat: CMakeFiles/EChat.dir/link.txt 98 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable EChat" 99 | $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/EChat.dir/link.txt --verbose=$(VERBOSE) 100 | 101 | # Rule to build all files generated by this target. 102 | CMakeFiles/EChat.dir/build: EChat 103 | .PHONY : CMakeFiles/EChat.dir/build 104 | 105 | CMakeFiles/EChat.dir/clean: 106 | $(CMAKE_COMMAND) -P CMakeFiles/EChat.dir/cmake_clean.cmake 107 | .PHONY : CMakeFiles/EChat.dir/clean 108 | 109 | CMakeFiles/EChat.dir/depend: 110 | cd /home/nb/EChat/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/nb/EChat /home/nb/EChat /home/nb/EChat/build /home/nb/EChat/build /home/nb/EChat/build/CMakeFiles/EChat.dir/DependInfo.cmake --color=$(COLOR) 111 | .PHONY : CMakeFiles/EChat.dir/depend 112 | 113 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/EChat.dir/main.cpp.o" 3 | "CMakeFiles/EChat.dir/main.cpp.o.d" 4 | "EChat" 5 | "EChat.pdb" 6 | ) 7 | 8 | # Per-language clean rules from dependency scanning. 9 | foreach(lang CXX) 10 | include(CMakeFiles/EChat.dir/cmake_clean_${lang}.cmake OPTIONAL) 11 | endforeach() 12 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/compiler_depend.ts: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Timestamp file for compiler generated dependencies management for EChat. 3 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for EChat. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_DEFINES = 6 | 7 | CXX_INCLUDES = -I/home/nb/EChat/include 8 | 9 | CXX_FLAGS = -std=gnu++11 10 | 11 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/c++ -rdynamic CMakeFiles/EChat.dir/main.cpp.o -o EChat -L/usr/local/lib -L/usr/lib64/mysql -Wl,-rpath,/usr/local/lib:/usr/lib64/mysql src/libechatlib.a -lmysqlclient ../lib/libjsoncpp.a 2 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/main.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/CMakeFiles/EChat.dir/main.cpp.o -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/EChat.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 1 2 | CMAKE_PROGRESS_2 = 2 3 | 4 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/Makefile.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # The generator used is: 5 | set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") 6 | 7 | # The top level Makefile was generated from the following files: 8 | set(CMAKE_MAKEFILE_DEPENDS 9 | "CMakeCache.txt" 10 | "../CMakeLists.txt" 11 | "CMakeFiles/3.22.1/CMakeCCompiler.cmake" 12 | "CMakeFiles/3.22.1/CMakeCXXCompiler.cmake" 13 | "CMakeFiles/3.22.1/CMakeSystem.cmake" 14 | "../src/CMakeLists.txt" 15 | "/usr/share/cmake-3.22/Modules/CMakeCInformation.cmake" 16 | "/usr/share/cmake-3.22/Modules/CMakeCXXInformation.cmake" 17 | "/usr/share/cmake-3.22/Modules/CMakeCommonLanguageInclude.cmake" 18 | "/usr/share/cmake-3.22/Modules/CMakeGenericSystem.cmake" 19 | "/usr/share/cmake-3.22/Modules/CMakeInitializeConfigs.cmake" 20 | "/usr/share/cmake-3.22/Modules/CMakeLanguageInformation.cmake" 21 | "/usr/share/cmake-3.22/Modules/CMakeSystemSpecificInformation.cmake" 22 | "/usr/share/cmake-3.22/Modules/CMakeSystemSpecificInitialize.cmake" 23 | "/usr/share/cmake-3.22/Modules/CheckCSourceCompiles.cmake" 24 | "/usr/share/cmake-3.22/Modules/CheckIncludeFile.cmake" 25 | "/usr/share/cmake-3.22/Modules/CheckLibraryExists.cmake" 26 | "/usr/share/cmake-3.22/Modules/Compiler/CMakeCommonCompilerMacros.cmake" 27 | "/usr/share/cmake-3.22/Modules/Compiler/GNU-C.cmake" 28 | "/usr/share/cmake-3.22/Modules/Compiler/GNU-CXX.cmake" 29 | "/usr/share/cmake-3.22/Modules/Compiler/GNU.cmake" 30 | "/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake" 31 | "/usr/share/cmake-3.22/Modules/FindPackageMessage.cmake" 32 | "/usr/share/cmake-3.22/Modules/FindThreads.cmake" 33 | "/usr/share/cmake-3.22/Modules/Internal/CheckSourceCompiles.cmake" 34 | "/usr/share/cmake-3.22/Modules/Platform/Linux-GNU-C.cmake" 35 | "/usr/share/cmake-3.22/Modules/Platform/Linux-GNU-CXX.cmake" 36 | "/usr/share/cmake-3.22/Modules/Platform/Linux-GNU.cmake" 37 | "/usr/share/cmake-3.22/Modules/Platform/Linux.cmake" 38 | "/usr/share/cmake-3.22/Modules/Platform/UnixPaths.cmake" 39 | ) 40 | 41 | # The corresponding makefile is: 42 | set(CMAKE_MAKEFILE_OUTPUTS 43 | "Makefile" 44 | "CMakeFiles/cmake.check_cache" 45 | ) 46 | 47 | # Byproducts of CMake generate step: 48 | set(CMAKE_MAKEFILE_PRODUCTS 49 | "CMakeFiles/CMakeDirectoryInformation.cmake" 50 | "src/CMakeFiles/CMakeDirectoryInformation.cmake" 51 | ) 52 | 53 | # Dependency information for all targets: 54 | set(CMAKE_DEPEND_INFO_FILES 55 | "CMakeFiles/EChat.dir/DependInfo.cmake" 56 | "src/CMakeFiles/echatlib.dir/DependInfo.cmake" 57 | ) 58 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/Makefile2: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | .PHONY : default_target 7 | 8 | #============================================================================= 9 | # Special targets provided by cmake. 10 | 11 | # Disable implicit rules so canonical targets will work. 12 | .SUFFIXES: 13 | 14 | # Disable VCS-based implicit rules. 15 | % : %,v 16 | 17 | # Disable VCS-based implicit rules. 18 | % : RCS/% 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/%,v 22 | 23 | # Disable VCS-based implicit rules. 24 | % : SCCS/s.% 25 | 26 | # Disable VCS-based implicit rules. 27 | % : s.% 28 | 29 | .SUFFIXES: .hpux_make_needs_suffix_list 30 | 31 | # Command-line flag to silence nested $(MAKE). 32 | $(VERBOSE)MAKESILENT = -s 33 | 34 | #Suppress display of executed commands. 35 | $(VERBOSE).SILENT: 36 | 37 | # A target that is always out of date. 38 | cmake_force: 39 | .PHONY : cmake_force 40 | 41 | #============================================================================= 42 | # Set environment variables for the build. 43 | 44 | # The shell in which to execute make rules. 45 | SHELL = /bin/sh 46 | 47 | # The CMake executable. 48 | CMAKE_COMMAND = /usr/bin/cmake 49 | 50 | # The command to remove a file. 51 | RM = /usr/bin/cmake -E rm -f 52 | 53 | # Escaping for special characters. 54 | EQUALS = = 55 | 56 | # The top-level source directory on which CMake was run. 57 | CMAKE_SOURCE_DIR = /home/nb/EChat 58 | 59 | # The top-level build directory on which CMake was run. 60 | CMAKE_BINARY_DIR = /home/nb/EChat/build 61 | 62 | #============================================================================= 63 | # Directory level rules for the build root directory 64 | 65 | # The main recursive "all" target. 66 | all: CMakeFiles/EChat.dir/all 67 | all: src/all 68 | .PHONY : all 69 | 70 | # The main recursive "preinstall" target. 71 | preinstall: src/preinstall 72 | .PHONY : preinstall 73 | 74 | # The main recursive "clean" target. 75 | clean: CMakeFiles/EChat.dir/clean 76 | clean: src/clean 77 | .PHONY : clean 78 | 79 | #============================================================================= 80 | # Directory level rules for directory src 81 | 82 | # Recursive "all" directory target. 83 | src/all: src/CMakeFiles/echatlib.dir/all 84 | .PHONY : src/all 85 | 86 | # Recursive "preinstall" directory target. 87 | src/preinstall: 88 | .PHONY : src/preinstall 89 | 90 | # Recursive "clean" directory target. 91 | src/clean: src/CMakeFiles/echatlib.dir/clean 92 | .PHONY : src/clean 93 | 94 | #============================================================================= 95 | # Target rules for target CMakeFiles/EChat.dir 96 | 97 | # All Build rule for target. 98 | CMakeFiles/EChat.dir/all: src/CMakeFiles/echatlib.dir/all 99 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/depend 100 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/build 101 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=1,2 "Built target EChat" 102 | .PHONY : CMakeFiles/EChat.dir/all 103 | 104 | # Build rule for subdir invocation for target. 105 | CMakeFiles/EChat.dir/rule: cmake_check_build_system 106 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles 6 107 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/EChat.dir/all 108 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles 0 109 | .PHONY : CMakeFiles/EChat.dir/rule 110 | 111 | # Convenience name for target. 112 | EChat: CMakeFiles/EChat.dir/rule 113 | .PHONY : EChat 114 | 115 | # clean rule for target. 116 | CMakeFiles/EChat.dir/clean: 117 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/clean 118 | .PHONY : CMakeFiles/EChat.dir/clean 119 | 120 | #============================================================================= 121 | # Target rules for target src/CMakeFiles/echatlib.dir 122 | 123 | # All Build rule for target. 124 | src/CMakeFiles/echatlib.dir/all: 125 | $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/depend 126 | $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/build 127 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=3,4,5,6 "Built target echatlib" 128 | .PHONY : src/CMakeFiles/echatlib.dir/all 129 | 130 | # Build rule for subdir invocation for target. 131 | src/CMakeFiles/echatlib.dir/rule: cmake_check_build_system 132 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles 4 133 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 src/CMakeFiles/echatlib.dir/all 134 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles 0 135 | .PHONY : src/CMakeFiles/echatlib.dir/rule 136 | 137 | # Convenience name for target. 138 | echatlib: src/CMakeFiles/echatlib.dir/rule 139 | .PHONY : echatlib 140 | 141 | # clean rule for target. 142 | src/CMakeFiles/echatlib.dir/clean: 143 | $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/clean 144 | .PHONY : src/CMakeFiles/echatlib.dir/clean 145 | 146 | #============================================================================= 147 | # Special targets to cleanup operation of make. 148 | 149 | # Special rule to run CMake to check the build system integrity. 150 | # No rule that depends on this can have commands that come from listfiles 151 | # because they might be regenerated. 152 | cmake_check_build_system: 153 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 154 | .PHONY : cmake_check_build_system 155 | 156 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/TargetDirectories.txt: -------------------------------------------------------------------------------- 1 | /home/nb/EChat/build/CMakeFiles/EChat.dir 2 | /home/nb/EChat/build/CMakeFiles/edit_cache.dir 3 | /home/nb/EChat/build/CMakeFiles/rebuild_cache.dir 4 | /home/nb/EChat/build/src/CMakeFiles/echatlib.dir 5 | /home/nb/EChat/build/src/CMakeFiles/edit_cache.dir 6 | /home/nb/EChat/build/src/CMakeFiles/rebuild_cache.dir 7 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/cmake.check_cache: -------------------------------------------------------------------------------- 1 | # This file is generated by cmake for dependency checking of the CMakeCache.txt file 2 | -------------------------------------------------------------------------------- /Server-EChat/build/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 6 2 | -------------------------------------------------------------------------------- /Server-EChat/build/EChat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/EChat -------------------------------------------------------------------------------- /Server-EChat/build/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | .PHONY : default_target 7 | 8 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 9 | .NOTPARALLEL: 10 | 11 | #============================================================================= 12 | # Special targets provided by cmake. 13 | 14 | # Disable implicit rules so canonical targets will work. 15 | .SUFFIXES: 16 | 17 | # Disable VCS-based implicit rules. 18 | % : %,v 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/% 22 | 23 | # Disable VCS-based implicit rules. 24 | % : RCS/%,v 25 | 26 | # Disable VCS-based implicit rules. 27 | % : SCCS/s.% 28 | 29 | # Disable VCS-based implicit rules. 30 | % : s.% 31 | 32 | .SUFFIXES: .hpux_make_needs_suffix_list 33 | 34 | # Command-line flag to silence nested $(MAKE). 35 | $(VERBOSE)MAKESILENT = -s 36 | 37 | #Suppress display of executed commands. 38 | $(VERBOSE).SILENT: 39 | 40 | # A target that is always out of date. 41 | cmake_force: 42 | .PHONY : cmake_force 43 | 44 | #============================================================================= 45 | # Set environment variables for the build. 46 | 47 | # The shell in which to execute make rules. 48 | SHELL = /bin/sh 49 | 50 | # The CMake executable. 51 | CMAKE_COMMAND = /usr/bin/cmake 52 | 53 | # The command to remove a file. 54 | RM = /usr/bin/cmake -E rm -f 55 | 56 | # Escaping for special characters. 57 | EQUALS = = 58 | 59 | # The top-level source directory on which CMake was run. 60 | CMAKE_SOURCE_DIR = /home/nb/EChat 61 | 62 | # The top-level build directory on which CMake was run. 63 | CMAKE_BINARY_DIR = /home/nb/EChat/build 64 | 65 | #============================================================================= 66 | # Targets provided globally by CMake. 67 | 68 | # Special rule for the target edit_cache 69 | edit_cache: 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 71 | /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 72 | .PHONY : edit_cache 73 | 74 | # Special rule for the target edit_cache 75 | edit_cache/fast: edit_cache 76 | .PHONY : edit_cache/fast 77 | 78 | # Special rule for the target rebuild_cache 79 | rebuild_cache: 80 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 81 | /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 82 | .PHONY : rebuild_cache 83 | 84 | # Special rule for the target rebuild_cache 85 | rebuild_cache/fast: rebuild_cache 86 | .PHONY : rebuild_cache/fast 87 | 88 | # The main all target 89 | all: cmake_check_build_system 90 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles /home/nb/EChat/build//CMakeFiles/progress.marks 91 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all 92 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles 0 93 | .PHONY : all 94 | 95 | # The main clean target 96 | clean: 97 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean 98 | .PHONY : clean 99 | 100 | # The main clean target 101 | clean/fast: clean 102 | .PHONY : clean/fast 103 | 104 | # Prepare targets for installation. 105 | preinstall: all 106 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall 107 | .PHONY : preinstall 108 | 109 | # Prepare targets for installation. 110 | preinstall/fast: 111 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall 112 | .PHONY : preinstall/fast 113 | 114 | # clear depends 115 | depend: 116 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 117 | .PHONY : depend 118 | 119 | #============================================================================= 120 | # Target rules for targets named EChat 121 | 122 | # Build rule for target. 123 | EChat: cmake_check_build_system 124 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 EChat 125 | .PHONY : EChat 126 | 127 | # fast build rule for target. 128 | EChat/fast: 129 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/build 130 | .PHONY : EChat/fast 131 | 132 | #============================================================================= 133 | # Target rules for targets named echatlib 134 | 135 | # Build rule for target. 136 | echatlib: cmake_check_build_system 137 | $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 echatlib 138 | .PHONY : echatlib 139 | 140 | # fast build rule for target. 141 | echatlib/fast: 142 | $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/build 143 | .PHONY : echatlib/fast 144 | 145 | main.o: main.cpp.o 146 | .PHONY : main.o 147 | 148 | # target to build an object file 149 | main.cpp.o: 150 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/main.cpp.o 151 | .PHONY : main.cpp.o 152 | 153 | main.i: main.cpp.i 154 | .PHONY : main.i 155 | 156 | # target to preprocess a source file 157 | main.cpp.i: 158 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/main.cpp.i 159 | .PHONY : main.cpp.i 160 | 161 | main.s: main.cpp.s 162 | .PHONY : main.s 163 | 164 | # target to generate assembly for a file 165 | main.cpp.s: 166 | $(MAKE) $(MAKESILENT) -f CMakeFiles/EChat.dir/build.make CMakeFiles/EChat.dir/main.cpp.s 167 | .PHONY : main.cpp.s 168 | 169 | # Help Target 170 | help: 171 | @echo "The following are some of the valid targets for this Makefile:" 172 | @echo "... all (the default if no target is provided)" 173 | @echo "... clean" 174 | @echo "... depend" 175 | @echo "... edit_cache" 176 | @echo "... rebuild_cache" 177 | @echo "... EChat" 178 | @echo "... echatlib" 179 | @echo "... main.o" 180 | @echo "... main.i" 181 | @echo "... main.s" 182 | .PHONY : help 183 | 184 | 185 | 186 | #============================================================================= 187 | # Special targets to cleanup operation of make. 188 | 189 | # Special rule to run CMake to check the build system integrity. 190 | # No rule that depends on this can have commands that come from listfiles 191 | # because they might be regenerated. 192 | cmake_check_build_system: 193 | $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 194 | .PHONY : cmake_check_build_system 195 | 196 | -------------------------------------------------------------------------------- /Server-EChat/build/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/nb/EChat 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | # Set default install directory permissions. 41 | if(NOT DEFINED CMAKE_OBJDUMP) 42 | set(CMAKE_OBJDUMP "/usr/bin/objdump") 43 | endif() 44 | 45 | if(NOT CMAKE_INSTALL_LOCAL_ONLY) 46 | # Include the install script for each subdirectory. 47 | include("/home/nb/EChat/build/src/cmake_install.cmake") 48 | 49 | endif() 50 | 51 | if(CMAKE_INSTALL_COMPONENT) 52 | set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") 53 | else() 54 | set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") 55 | endif() 56 | 57 | string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT 58 | "${CMAKE_INSTALL_MANIFEST_FILES}") 59 | file(WRITE "/home/nb/EChat/build/${CMAKE_INSTALL_MANIFEST}" 60 | "${CMAKE_INSTALL_MANIFEST_CONTENT}") 61 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/CMakeDirectoryInformation.cmake: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Relative path conversion top directories. 5 | set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/nb/EChat") 6 | set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/nb/EChat/build") 7 | 8 | # Force unix paths in dependencies. 9 | set(CMAKE_FORCE_UNIX_PATHS 1) 10 | 11 | 12 | # The C and CXX include file regular expressions for this directory. 13 | set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") 14 | set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") 15 | set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) 16 | set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) 17 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/DataBase.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/src/CMakeFiles/echatlib.dir/DataBase.cpp.o -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/DependInfo.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Consider dependencies only in project. 3 | set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) 4 | 5 | # The set of languages for which implicit dependencies are needed: 6 | set(CMAKE_DEPENDS_LANGUAGES 7 | ) 8 | 9 | # The set of dependency files which are needed: 10 | set(CMAKE_DEPENDS_DEPENDENCY_FILES 11 | "/home/nb/EChat/src/DataBase.cpp" "src/CMakeFiles/echatlib.dir/DataBase.cpp.o" "gcc" "src/CMakeFiles/echatlib.dir/DataBase.cpp.o.d" 12 | "/home/nb/EChat/src/FdTool.cpp" "src/CMakeFiles/echatlib.dir/FdTool.cpp.o" "gcc" "src/CMakeFiles/echatlib.dir/FdTool.cpp.o.d" 13 | "/home/nb/EChat/src/Server.cpp" "src/CMakeFiles/echatlib.dir/Server.cpp.o" "gcc" "src/CMakeFiles/echatlib.dir/Server.cpp.o.d" 14 | ) 15 | 16 | # Targets to which this target links. 17 | set(CMAKE_TARGET_LINKED_INFO_FILES 18 | ) 19 | 20 | # Fortran module output directory. 21 | set(CMAKE_Fortran_TARGET_MODULE_DIR "") 22 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/FdTool.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/src/CMakeFiles/echatlib.dir/FdTool.cpp.o -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/FdTool.cpp.o.d: -------------------------------------------------------------------------------- 1 | src/CMakeFiles/echatlib.dir/FdTool.cpp.o: /home/nb/EChat/src/FdTool.cpp \ 2 | /usr/include/stdc-predef.h /usr/include/c++/11/iostream \ 3 | /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h \ 4 | /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h \ 5 | /usr/include/features.h /usr/include/features-time64.h \ 6 | /usr/include/x86_64-linux-gnu/bits/wordsize.h \ 7 | /usr/include/x86_64-linux-gnu/bits/timesize.h \ 8 | /usr/include/x86_64-linux-gnu/sys/cdefs.h \ 9 | /usr/include/x86_64-linux-gnu/bits/long-double.h \ 10 | /usr/include/x86_64-linux-gnu/gnu/stubs.h \ 11 | /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ 12 | /usr/include/x86_64-linux-gnu/c++/11/bits/cpu_defines.h \ 13 | /usr/include/c++/11/ostream /usr/include/c++/11/ios \ 14 | /usr/include/c++/11/iosfwd /usr/include/c++/11/bits/stringfwd.h \ 15 | /usr/include/c++/11/bits/memoryfwd.h /usr/include/c++/11/bits/postypes.h \ 16 | /usr/include/c++/11/cwchar /usr/include/wchar.h \ 17 | /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ 18 | /usr/include/x86_64-linux-gnu/bits/floatn.h \ 19 | /usr/include/x86_64-linux-gnu/bits/floatn-common.h \ 20 | /usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h \ 21 | /usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h \ 22 | /usr/include/x86_64-linux-gnu/bits/wchar.h \ 23 | /usr/include/x86_64-linux-gnu/bits/types/wint_t.h \ 24 | /usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h \ 25 | /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ 26 | /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ 27 | /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ 28 | /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ 29 | /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ 30 | /usr/include/c++/11/exception /usr/include/c++/11/bits/exception.h \ 31 | /usr/include/c++/11/bits/exception_ptr.h \ 32 | /usr/include/c++/11/bits/exception_defines.h \ 33 | /usr/include/c++/11/bits/cxxabi_init_exception.h \ 34 | /usr/include/c++/11/typeinfo /usr/include/c++/11/bits/hash_bytes.h \ 35 | /usr/include/c++/11/new /usr/include/c++/11/bits/move.h \ 36 | /usr/include/c++/11/type_traits \ 37 | /usr/include/c++/11/bits/nested_exception.h \ 38 | /usr/include/c++/11/bits/char_traits.h \ 39 | /usr/include/c++/11/bits/stl_algobase.h \ 40 | /usr/include/c++/11/bits/functexcept.h \ 41 | /usr/include/c++/11/bits/cpp_type_traits.h \ 42 | /usr/include/c++/11/ext/type_traits.h \ 43 | /usr/include/c++/11/ext/numeric_traits.h \ 44 | /usr/include/c++/11/bits/stl_pair.h \ 45 | /usr/include/c++/11/bits/stl_iterator_base_types.h \ 46 | /usr/include/c++/11/bits/stl_iterator_base_funcs.h \ 47 | /usr/include/c++/11/bits/concept_check.h \ 48 | /usr/include/c++/11/debug/assertions.h \ 49 | /usr/include/c++/11/bits/stl_iterator.h \ 50 | /usr/include/c++/11/bits/ptr_traits.h /usr/include/c++/11/debug/debug.h \ 51 | /usr/include/c++/11/bits/predefined_ops.h /usr/include/c++/11/cstdint \ 52 | /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h /usr/include/stdint.h \ 53 | /usr/include/x86_64-linux-gnu/bits/types.h \ 54 | /usr/include/x86_64-linux-gnu/bits/typesizes.h \ 55 | /usr/include/x86_64-linux-gnu/bits/time64.h \ 56 | /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ 57 | /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ 58 | /usr/include/c++/11/bits/localefwd.h \ 59 | /usr/include/x86_64-linux-gnu/c++/11/bits/c++locale.h \ 60 | /usr/include/c++/11/clocale /usr/include/locale.h \ 61 | /usr/include/x86_64-linux-gnu/bits/locale.h /usr/include/c++/11/cctype \ 62 | /usr/include/ctype.h /usr/include/x86_64-linux-gnu/bits/endian.h \ 63 | /usr/include/x86_64-linux-gnu/bits/endianness.h \ 64 | /usr/include/c++/11/bits/ios_base.h /usr/include/c++/11/ext/atomicity.h \ 65 | /usr/include/x86_64-linux-gnu/c++/11/bits/gthr.h \ 66 | /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h \ 67 | /usr/include/pthread.h /usr/include/sched.h \ 68 | /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ 69 | /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ 70 | /usr/include/x86_64-linux-gnu/bits/sched.h \ 71 | /usr/include/x86_64-linux-gnu/bits/types/struct_sched_param.h \ 72 | /usr/include/x86_64-linux-gnu/bits/cpu-set.h /usr/include/time.h \ 73 | /usr/include/x86_64-linux-gnu/bits/time.h \ 74 | /usr/include/x86_64-linux-gnu/bits/timex.h \ 75 | /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ 76 | /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ 77 | /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ 78 | /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ 79 | /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \ 80 | /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ 81 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ 82 | /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ 83 | /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ 84 | /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ 85 | /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ 86 | /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h \ 87 | /usr/include/x86_64-linux-gnu/bits/setjmp.h \ 88 | /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ 89 | /usr/include/x86_64-linux-gnu/bits/types/struct___jmp_buf_tag.h \ 90 | /usr/include/x86_64-linux-gnu/bits/pthread_stack_min-dynamic.h \ 91 | /usr/include/x86_64-linux-gnu/c++/11/bits/atomic_word.h \ 92 | /usr/include/x86_64-linux-gnu/sys/single_threaded.h \ 93 | /usr/include/c++/11/bits/locale_classes.h /usr/include/c++/11/string \ 94 | /usr/include/c++/11/bits/allocator.h \ 95 | /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h \ 96 | /usr/include/c++/11/ext/new_allocator.h \ 97 | /usr/include/c++/11/bits/ostream_insert.h \ 98 | /usr/include/c++/11/bits/cxxabi_forced.h \ 99 | /usr/include/c++/11/bits/stl_function.h \ 100 | /usr/include/c++/11/backward/binders.h \ 101 | /usr/include/c++/11/bits/range_access.h \ 102 | /usr/include/c++/11/initializer_list \ 103 | /usr/include/c++/11/bits/basic_string.h \ 104 | /usr/include/c++/11/ext/alloc_traits.h \ 105 | /usr/include/c++/11/bits/alloc_traits.h \ 106 | /usr/include/c++/11/bits/stl_construct.h \ 107 | /usr/include/c++/11/ext/string_conversions.h /usr/include/c++/11/cstdlib \ 108 | /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ 109 | /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ 110 | /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/endian.h \ 111 | /usr/include/x86_64-linux-gnu/bits/byteswap.h \ 112 | /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ 113 | /usr/include/x86_64-linux-gnu/sys/select.h \ 114 | /usr/include/x86_64-linux-gnu/bits/select.h \ 115 | /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ 116 | /usr/include/alloca.h /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ 117 | /usr/include/c++/11/bits/std_abs.h /usr/include/c++/11/cstdio \ 118 | /usr/include/stdio.h /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ 119 | /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ 120 | /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ 121 | /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h \ 122 | /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ 123 | /usr/include/c++/11/cerrno /usr/include/errno.h \ 124 | /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ 125 | /usr/include/x86_64-linux-gnu/asm/errno.h \ 126 | /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ 127 | /usr/include/x86_64-linux-gnu/bits/types/error_t.h \ 128 | /usr/include/c++/11/bits/charconv.h \ 129 | /usr/include/c++/11/bits/functional_hash.h \ 130 | /usr/include/c++/11/bits/basic_string.tcc \ 131 | /usr/include/c++/11/bits/locale_classes.tcc \ 132 | /usr/include/c++/11/system_error \ 133 | /usr/include/x86_64-linux-gnu/c++/11/bits/error_constants.h \ 134 | /usr/include/c++/11/stdexcept /usr/include/c++/11/streambuf \ 135 | /usr/include/c++/11/bits/streambuf.tcc \ 136 | /usr/include/c++/11/bits/basic_ios.h \ 137 | /usr/include/c++/11/bits/locale_facets.h /usr/include/c++/11/cwctype \ 138 | /usr/include/wctype.h /usr/include/x86_64-linux-gnu/bits/wctype-wchar.h \ 139 | /usr/include/x86_64-linux-gnu/c++/11/bits/ctype_base.h \ 140 | /usr/include/c++/11/bits/streambuf_iterator.h \ 141 | /usr/include/x86_64-linux-gnu/c++/11/bits/ctype_inline.h \ 142 | /usr/include/c++/11/bits/locale_facets.tcc \ 143 | /usr/include/c++/11/bits/basic_ios.tcc \ 144 | /usr/include/c++/11/bits/ostream.tcc /usr/include/c++/11/istream \ 145 | /usr/include/c++/11/bits/istream.tcc /usr/include/c++/11/map \ 146 | /usr/include/c++/11/bits/stl_tree.h \ 147 | /usr/include/c++/11/ext/aligned_buffer.h \ 148 | /usr/include/c++/11/bits/stl_map.h /usr/include/c++/11/tuple \ 149 | /usr/include/c++/11/utility /usr/include/c++/11/bits/stl_relops.h \ 150 | /usr/include/c++/11/array /usr/include/c++/11/bits/uses_allocator.h \ 151 | /usr/include/c++/11/bits/invoke.h \ 152 | /usr/include/c++/11/bits/stl_multimap.h \ 153 | /usr/include/c++/11/bits/erase_if.h /usr/include/c++/11/list \ 154 | /usr/include/c++/11/bits/stl_list.h \ 155 | /usr/include/c++/11/bits/allocated_ptr.h \ 156 | /usr/include/c++/11/bits/list.tcc /usr/include/c++/11/vector \ 157 | /usr/include/c++/11/bits/stl_uninitialized.h \ 158 | /usr/include/c++/11/bits/stl_vector.h \ 159 | /usr/include/c++/11/bits/stl_bvector.h \ 160 | /usr/include/c++/11/bits/vector.tcc 161 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/Server.cpp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/src/CMakeFiles/echatlib.dir/Server.cpp.o -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/build.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Delete rule output on recipe failure. 5 | .DELETE_ON_ERROR: 6 | 7 | #============================================================================= 8 | # Special targets provided by cmake. 9 | 10 | # Disable implicit rules so canonical targets will work. 11 | .SUFFIXES: 12 | 13 | # Disable VCS-based implicit rules. 14 | % : %,v 15 | 16 | # Disable VCS-based implicit rules. 17 | % : RCS/% 18 | 19 | # Disable VCS-based implicit rules. 20 | % : RCS/%,v 21 | 22 | # Disable VCS-based implicit rules. 23 | % : SCCS/s.% 24 | 25 | # Disable VCS-based implicit rules. 26 | % : s.% 27 | 28 | .SUFFIXES: .hpux_make_needs_suffix_list 29 | 30 | # Command-line flag to silence nested $(MAKE). 31 | $(VERBOSE)MAKESILENT = -s 32 | 33 | #Suppress display of executed commands. 34 | $(VERBOSE).SILENT: 35 | 36 | # A target that is always out of date. 37 | cmake_force: 38 | .PHONY : cmake_force 39 | 40 | #============================================================================= 41 | # Set environment variables for the build. 42 | 43 | # The shell in which to execute make rules. 44 | SHELL = /bin/sh 45 | 46 | # The CMake executable. 47 | CMAKE_COMMAND = /usr/bin/cmake 48 | 49 | # The command to remove a file. 50 | RM = /usr/bin/cmake -E rm -f 51 | 52 | # Escaping for special characters. 53 | EQUALS = = 54 | 55 | # The top-level source directory on which CMake was run. 56 | CMAKE_SOURCE_DIR = /home/nb/EChat 57 | 58 | # The top-level build directory on which CMake was run. 59 | CMAKE_BINARY_DIR = /home/nb/EChat/build 60 | 61 | # Include any dependencies generated for this target. 62 | include src/CMakeFiles/echatlib.dir/depend.make 63 | # Include any dependencies generated by the compiler for this target. 64 | include src/CMakeFiles/echatlib.dir/compiler_depend.make 65 | 66 | # Include the progress variables for this target. 67 | include src/CMakeFiles/echatlib.dir/progress.make 68 | 69 | # Include the compile flags for this target's objects. 70 | include src/CMakeFiles/echatlib.dir/flags.make 71 | 72 | src/CMakeFiles/echatlib.dir/DataBase.cpp.o: src/CMakeFiles/echatlib.dir/flags.make 73 | src/CMakeFiles/echatlib.dir/DataBase.cpp.o: ../src/DataBase.cpp 74 | src/CMakeFiles/echatlib.dir/DataBase.cpp.o: src/CMakeFiles/echatlib.dir/compiler_depend.ts 75 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object src/CMakeFiles/echatlib.dir/DataBase.cpp.o" 76 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT src/CMakeFiles/echatlib.dir/DataBase.cpp.o -MF CMakeFiles/echatlib.dir/DataBase.cpp.o.d -o CMakeFiles/echatlib.dir/DataBase.cpp.o -c /home/nb/EChat/src/DataBase.cpp 77 | 78 | src/CMakeFiles/echatlib.dir/DataBase.cpp.i: cmake_force 79 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/echatlib.dir/DataBase.cpp.i" 80 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/nb/EChat/src/DataBase.cpp > CMakeFiles/echatlib.dir/DataBase.cpp.i 81 | 82 | src/CMakeFiles/echatlib.dir/DataBase.cpp.s: cmake_force 83 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/echatlib.dir/DataBase.cpp.s" 84 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/nb/EChat/src/DataBase.cpp -o CMakeFiles/echatlib.dir/DataBase.cpp.s 85 | 86 | src/CMakeFiles/echatlib.dir/FdTool.cpp.o: src/CMakeFiles/echatlib.dir/flags.make 87 | src/CMakeFiles/echatlib.dir/FdTool.cpp.o: ../src/FdTool.cpp 88 | src/CMakeFiles/echatlib.dir/FdTool.cpp.o: src/CMakeFiles/echatlib.dir/compiler_depend.ts 89 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object src/CMakeFiles/echatlib.dir/FdTool.cpp.o" 90 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT src/CMakeFiles/echatlib.dir/FdTool.cpp.o -MF CMakeFiles/echatlib.dir/FdTool.cpp.o.d -o CMakeFiles/echatlib.dir/FdTool.cpp.o -c /home/nb/EChat/src/FdTool.cpp 91 | 92 | src/CMakeFiles/echatlib.dir/FdTool.cpp.i: cmake_force 93 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/echatlib.dir/FdTool.cpp.i" 94 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/nb/EChat/src/FdTool.cpp > CMakeFiles/echatlib.dir/FdTool.cpp.i 95 | 96 | src/CMakeFiles/echatlib.dir/FdTool.cpp.s: cmake_force 97 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/echatlib.dir/FdTool.cpp.s" 98 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/nb/EChat/src/FdTool.cpp -o CMakeFiles/echatlib.dir/FdTool.cpp.s 99 | 100 | src/CMakeFiles/echatlib.dir/Server.cpp.o: src/CMakeFiles/echatlib.dir/flags.make 101 | src/CMakeFiles/echatlib.dir/Server.cpp.o: ../src/Server.cpp 102 | src/CMakeFiles/echatlib.dir/Server.cpp.o: src/CMakeFiles/echatlib.dir/compiler_depend.ts 103 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object src/CMakeFiles/echatlib.dir/Server.cpp.o" 104 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT src/CMakeFiles/echatlib.dir/Server.cpp.o -MF CMakeFiles/echatlib.dir/Server.cpp.o.d -o CMakeFiles/echatlib.dir/Server.cpp.o -c /home/nb/EChat/src/Server.cpp 105 | 106 | src/CMakeFiles/echatlib.dir/Server.cpp.i: cmake_force 107 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/echatlib.dir/Server.cpp.i" 108 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/nb/EChat/src/Server.cpp > CMakeFiles/echatlib.dir/Server.cpp.i 109 | 110 | src/CMakeFiles/echatlib.dir/Server.cpp.s: cmake_force 111 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/echatlib.dir/Server.cpp.s" 112 | cd /home/nb/EChat/build/src && /usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/nb/EChat/src/Server.cpp -o CMakeFiles/echatlib.dir/Server.cpp.s 113 | 114 | # Object files for target echatlib 115 | echatlib_OBJECTS = \ 116 | "CMakeFiles/echatlib.dir/DataBase.cpp.o" \ 117 | "CMakeFiles/echatlib.dir/FdTool.cpp.o" \ 118 | "CMakeFiles/echatlib.dir/Server.cpp.o" 119 | 120 | # External object files for target echatlib 121 | echatlib_EXTERNAL_OBJECTS = 122 | 123 | src/libechatlib.a: src/CMakeFiles/echatlib.dir/DataBase.cpp.o 124 | src/libechatlib.a: src/CMakeFiles/echatlib.dir/FdTool.cpp.o 125 | src/libechatlib.a: src/CMakeFiles/echatlib.dir/Server.cpp.o 126 | src/libechatlib.a: src/CMakeFiles/echatlib.dir/build.make 127 | src/libechatlib.a: src/CMakeFiles/echatlib.dir/link.txt 128 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/nb/EChat/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Linking CXX static library libechatlib.a" 129 | cd /home/nb/EChat/build/src && $(CMAKE_COMMAND) -P CMakeFiles/echatlib.dir/cmake_clean_target.cmake 130 | cd /home/nb/EChat/build/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/echatlib.dir/link.txt --verbose=$(VERBOSE) 131 | 132 | # Rule to build all files generated by this target. 133 | src/CMakeFiles/echatlib.dir/build: src/libechatlib.a 134 | .PHONY : src/CMakeFiles/echatlib.dir/build 135 | 136 | src/CMakeFiles/echatlib.dir/clean: 137 | cd /home/nb/EChat/build/src && $(CMAKE_COMMAND) -P CMakeFiles/echatlib.dir/cmake_clean.cmake 138 | .PHONY : src/CMakeFiles/echatlib.dir/clean 139 | 140 | src/CMakeFiles/echatlib.dir/depend: 141 | cd /home/nb/EChat/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/nb/EChat /home/nb/EChat/src /home/nb/EChat/build /home/nb/EChat/build/src /home/nb/EChat/build/src/CMakeFiles/echatlib.dir/DependInfo.cmake --color=$(COLOR) 142 | .PHONY : src/CMakeFiles/echatlib.dir/depend 143 | 144 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/cmake_clean.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "CMakeFiles/echatlib.dir/DataBase.cpp.o" 3 | "CMakeFiles/echatlib.dir/DataBase.cpp.o.d" 4 | "CMakeFiles/echatlib.dir/FdTool.cpp.o" 5 | "CMakeFiles/echatlib.dir/FdTool.cpp.o.d" 6 | "CMakeFiles/echatlib.dir/Server.cpp.o" 7 | "CMakeFiles/echatlib.dir/Server.cpp.o.d" 8 | "libechatlib.a" 9 | "libechatlib.pdb" 10 | ) 11 | 12 | # Per-language clean rules from dependency scanning. 13 | foreach(lang CXX) 14 | include(CMakeFiles/echatlib.dir/cmake_clean_${lang}.cmake OPTIONAL) 15 | endforeach() 16 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/cmake_clean_target.cmake: -------------------------------------------------------------------------------- 1 | file(REMOVE_RECURSE 2 | "libechatlib.a" 3 | ) 4 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/compiler_depend.ts: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Timestamp file for compiler generated dependencies management for echatlib. 3 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/depend.make: -------------------------------------------------------------------------------- 1 | # Empty dependencies file for echatlib. 2 | # This may be replaced when dependencies are built. 3 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/flags.make: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # compile CXX with /usr/bin/c++ 5 | CXX_DEFINES = 6 | 7 | CXX_INCLUDES = -I/home/nb/EChat/include 8 | 9 | CXX_FLAGS = -std=gnu++11 10 | 11 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/link.txt: -------------------------------------------------------------------------------- 1 | /usr/bin/ar qc libechatlib.a CMakeFiles/echatlib.dir/DataBase.cpp.o CMakeFiles/echatlib.dir/FdTool.cpp.o CMakeFiles/echatlib.dir/Server.cpp.o 2 | /usr/bin/ranlib libechatlib.a 3 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/echatlib.dir/progress.make: -------------------------------------------------------------------------------- 1 | CMAKE_PROGRESS_1 = 3 2 | CMAKE_PROGRESS_2 = 4 3 | CMAKE_PROGRESS_3 = 5 4 | CMAKE_PROGRESS_4 = 6 5 | 6 | -------------------------------------------------------------------------------- /Server-EChat/build/src/CMakeFiles/progress.marks: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /Server-EChat/build/src/Makefile: -------------------------------------------------------------------------------- 1 | # CMAKE generated file: DO NOT EDIT! 2 | # Generated by "Unix Makefiles" Generator, CMake Version 3.22 3 | 4 | # Default target executed when no arguments are given to make. 5 | default_target: all 6 | .PHONY : default_target 7 | 8 | # Allow only one "make -f Makefile2" at a time, but pass parallelism. 9 | .NOTPARALLEL: 10 | 11 | #============================================================================= 12 | # Special targets provided by cmake. 13 | 14 | # Disable implicit rules so canonical targets will work. 15 | .SUFFIXES: 16 | 17 | # Disable VCS-based implicit rules. 18 | % : %,v 19 | 20 | # Disable VCS-based implicit rules. 21 | % : RCS/% 22 | 23 | # Disable VCS-based implicit rules. 24 | % : RCS/%,v 25 | 26 | # Disable VCS-based implicit rules. 27 | % : SCCS/s.% 28 | 29 | # Disable VCS-based implicit rules. 30 | % : s.% 31 | 32 | .SUFFIXES: .hpux_make_needs_suffix_list 33 | 34 | # Command-line flag to silence nested $(MAKE). 35 | $(VERBOSE)MAKESILENT = -s 36 | 37 | #Suppress display of executed commands. 38 | $(VERBOSE).SILENT: 39 | 40 | # A target that is always out of date. 41 | cmake_force: 42 | .PHONY : cmake_force 43 | 44 | #============================================================================= 45 | # Set environment variables for the build. 46 | 47 | # The shell in which to execute make rules. 48 | SHELL = /bin/sh 49 | 50 | # The CMake executable. 51 | CMAKE_COMMAND = /usr/bin/cmake 52 | 53 | # The command to remove a file. 54 | RM = /usr/bin/cmake -E rm -f 55 | 56 | # Escaping for special characters. 57 | EQUALS = = 58 | 59 | # The top-level source directory on which CMake was run. 60 | CMAKE_SOURCE_DIR = /home/nb/EChat 61 | 62 | # The top-level build directory on which CMake was run. 63 | CMAKE_BINARY_DIR = /home/nb/EChat/build 64 | 65 | #============================================================================= 66 | # Targets provided globally by CMake. 67 | 68 | # Special rule for the target edit_cache 69 | edit_cache: 70 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." 71 | /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. 72 | .PHONY : edit_cache 73 | 74 | # Special rule for the target edit_cache 75 | edit_cache/fast: edit_cache 76 | .PHONY : edit_cache/fast 77 | 78 | # Special rule for the target rebuild_cache 79 | rebuild_cache: 80 | @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." 81 | /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) 82 | .PHONY : rebuild_cache 83 | 84 | # Special rule for the target rebuild_cache 85 | rebuild_cache/fast: rebuild_cache 86 | .PHONY : rebuild_cache/fast 87 | 88 | # The main all target 89 | all: cmake_check_build_system 90 | cd /home/nb/EChat/build && $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles /home/nb/EChat/build/src//CMakeFiles/progress.marks 91 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 src/all 92 | $(CMAKE_COMMAND) -E cmake_progress_start /home/nb/EChat/build/CMakeFiles 0 93 | .PHONY : all 94 | 95 | # The main clean target 96 | clean: 97 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 src/clean 98 | .PHONY : clean 99 | 100 | # The main clean target 101 | clean/fast: clean 102 | .PHONY : clean/fast 103 | 104 | # Prepare targets for installation. 105 | preinstall: all 106 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 src/preinstall 107 | .PHONY : preinstall 108 | 109 | # Prepare targets for installation. 110 | preinstall/fast: 111 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 src/preinstall 112 | .PHONY : preinstall/fast 113 | 114 | # clear depends 115 | depend: 116 | cd /home/nb/EChat/build && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 117 | .PHONY : depend 118 | 119 | # Convenience name for target. 120 | src/CMakeFiles/echatlib.dir/rule: 121 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 src/CMakeFiles/echatlib.dir/rule 122 | .PHONY : src/CMakeFiles/echatlib.dir/rule 123 | 124 | # Convenience name for target. 125 | echatlib: src/CMakeFiles/echatlib.dir/rule 126 | .PHONY : echatlib 127 | 128 | # fast build rule for target. 129 | echatlib/fast: 130 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/build 131 | .PHONY : echatlib/fast 132 | 133 | DataBase.o: DataBase.cpp.o 134 | .PHONY : DataBase.o 135 | 136 | # target to build an object file 137 | DataBase.cpp.o: 138 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/DataBase.cpp.o 139 | .PHONY : DataBase.cpp.o 140 | 141 | DataBase.i: DataBase.cpp.i 142 | .PHONY : DataBase.i 143 | 144 | # target to preprocess a source file 145 | DataBase.cpp.i: 146 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/DataBase.cpp.i 147 | .PHONY : DataBase.cpp.i 148 | 149 | DataBase.s: DataBase.cpp.s 150 | .PHONY : DataBase.s 151 | 152 | # target to generate assembly for a file 153 | DataBase.cpp.s: 154 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/DataBase.cpp.s 155 | .PHONY : DataBase.cpp.s 156 | 157 | FdTool.o: FdTool.cpp.o 158 | .PHONY : FdTool.o 159 | 160 | # target to build an object file 161 | FdTool.cpp.o: 162 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/FdTool.cpp.o 163 | .PHONY : FdTool.cpp.o 164 | 165 | FdTool.i: FdTool.cpp.i 166 | .PHONY : FdTool.i 167 | 168 | # target to preprocess a source file 169 | FdTool.cpp.i: 170 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/FdTool.cpp.i 171 | .PHONY : FdTool.cpp.i 172 | 173 | FdTool.s: FdTool.cpp.s 174 | .PHONY : FdTool.s 175 | 176 | # target to generate assembly for a file 177 | FdTool.cpp.s: 178 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/FdTool.cpp.s 179 | .PHONY : FdTool.cpp.s 180 | 181 | Server.o: Server.cpp.o 182 | .PHONY : Server.o 183 | 184 | # target to build an object file 185 | Server.cpp.o: 186 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/Server.cpp.o 187 | .PHONY : Server.cpp.o 188 | 189 | Server.i: Server.cpp.i 190 | .PHONY : Server.i 191 | 192 | # target to preprocess a source file 193 | Server.cpp.i: 194 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/Server.cpp.i 195 | .PHONY : Server.cpp.i 196 | 197 | Server.s: Server.cpp.s 198 | .PHONY : Server.s 199 | 200 | # target to generate assembly for a file 201 | Server.cpp.s: 202 | cd /home/nb/EChat/build && $(MAKE) $(MAKESILENT) -f src/CMakeFiles/echatlib.dir/build.make src/CMakeFiles/echatlib.dir/Server.cpp.s 203 | .PHONY : Server.cpp.s 204 | 205 | # Help Target 206 | help: 207 | @echo "The following are some of the valid targets for this Makefile:" 208 | @echo "... all (the default if no target is provided)" 209 | @echo "... clean" 210 | @echo "... depend" 211 | @echo "... edit_cache" 212 | @echo "... rebuild_cache" 213 | @echo "... echatlib" 214 | @echo "... DataBase.o" 215 | @echo "... DataBase.i" 216 | @echo "... DataBase.s" 217 | @echo "... FdTool.o" 218 | @echo "... FdTool.i" 219 | @echo "... FdTool.s" 220 | @echo "... Server.o" 221 | @echo "... Server.i" 222 | @echo "... Server.s" 223 | .PHONY : help 224 | 225 | 226 | 227 | #============================================================================= 228 | # Special targets to cleanup operation of make. 229 | 230 | # Special rule to run CMake to check the build system integrity. 231 | # No rule that depends on this can have commands that come from listfiles 232 | # because they might be regenerated. 233 | cmake_check_build_system: 234 | cd /home/nb/EChat/build && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 235 | .PHONY : cmake_check_build_system 236 | 237 | -------------------------------------------------------------------------------- /Server-EChat/build/src/cmake_install.cmake: -------------------------------------------------------------------------------- 1 | # Install script for directory: /home/nb/EChat/src 2 | 3 | # Set the install prefix 4 | if(NOT DEFINED CMAKE_INSTALL_PREFIX) 5 | set(CMAKE_INSTALL_PREFIX "/usr/local") 6 | endif() 7 | string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 8 | 9 | # Set the install configuration name. 10 | if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) 11 | if(BUILD_TYPE) 12 | string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" 13 | CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") 14 | else() 15 | set(CMAKE_INSTALL_CONFIG_NAME "") 16 | endif() 17 | message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") 18 | endif() 19 | 20 | # Set the component getting installed. 21 | if(NOT CMAKE_INSTALL_COMPONENT) 22 | if(COMPONENT) 23 | message(STATUS "Install component: \"${COMPONENT}\"") 24 | set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") 25 | else() 26 | set(CMAKE_INSTALL_COMPONENT) 27 | endif() 28 | endif() 29 | 30 | # Install shared libraries without execute permission? 31 | if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) 32 | set(CMAKE_INSTALL_SO_NO_EXE "1") 33 | endif() 34 | 35 | # Is this installation the result of a crosscompile? 36 | if(NOT DEFINED CMAKE_CROSSCOMPILING) 37 | set(CMAKE_CROSSCOMPILING "FALSE") 38 | endif() 39 | 40 | # Set default install directory permissions. 41 | if(NOT DEFINED CMAKE_OBJDUMP) 42 | set(CMAKE_OBJDUMP "/usr/bin/objdump") 43 | endif() 44 | 45 | -------------------------------------------------------------------------------- /Server-EChat/build/src/libechatlib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/build/src/libechatlib.a -------------------------------------------------------------------------------- /Server-EChat/include/DataBase.h: -------------------------------------------------------------------------------- 1 | #ifndef _DATABASE_H 2 | #define _DATABASE_H 3 | 4 | #include 5 | using std::cin; 6 | using std::cout; 7 | using std::endl; 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | #include "json/json.h" 20 | 21 | #define DEFAULT_HOST "127.0.0.1" // 默认主机 22 | #define DEFAULT_USER "root" // 默认用户 23 | #define DEFAULT_PASSWORD "root" // 默认密码 24 | #define DEFAULT_DATABASE "echat" // 默认数据库 25 | 26 | #define MSG_MAX_ROWS 100 // 默认读取历史消息行数 27 | 28 | extern bool GetOnlineState(const int &usrId); 29 | extern std::map> groups; // id - 群成员 30 | 31 | class DataBase 32 | { 33 | public: 34 | static DataBase *GetInstance() { return instance; } 35 | 36 | bool ConnectDB(const std::string host = DEFAULT_HOST, const std::string usr = DEFAULT_USER, 37 | const std::string pwd = DEFAULT_PASSWORD, const std::string db = DEFAULT_DATABASE); 38 | void CloseDB(); 39 | 40 | // bool GenerateDiffID(int min, int max, int num); // 生成不重复ID-√ 41 | bool getNewID(int &newId); // 获取新Id(新Id表)-√ 42 | bool DeleteNewID(int &newId); // 删除Id(新Id表)-√ 43 | 44 | bool InitUI(Json::Value &outValue, const int &usrId); // 45 | 46 | bool AddUserRecommends(const int &usrId, std::string &text); // 用户建议 47 | 48 | bool QueryUser(const int &usrId); // 查询用户(用户表)-√ 49 | bool Login(const int &usrId, const std::string &usrPwd); // 验证用户(用户表)-√ 50 | bool Register(const int &newId, const std::string &nickname, const std::string &usrPwd); // 注册用户(用户表)-√ 51 | bool QueryFriendInfo(Json::Value &outValue, const int &usrId, const int &frdId); // 查询好友详细信息(用户表)-√ 52 | bool UpdateUserInfo(const int &usrId, Json::Value &rootObj); // 更新用户信息(用户表)-√ 53 | bool UpdateUserPassword(const int &usrId, const std::string &newPwd); // 更新用户密码(用户表)-√ 54 | bool UpdateUserPicture(const int &usrId, const int &picture); // 更新用户头像(用户表)-√ 55 | bool QueryUserInfo(Json::Value &outValue, const int &usrId); // 查询用户信息(用户表)-√ 56 | 57 | bool AddUserApply(const int &applicant, const int &reviewer, 58 | const int &type, const int &grpId, const std::string &ps); // 添加好友/群聊申请(申请表)-√ 59 | bool DeleteUserApply(const int &applicant, const int &reviewer, const int &type); // 删除好友/群聊申请(申请表)-√ 60 | bool QueryUserApply(Json::Value &outValue, const int &usrId, const int &sideId, const bool &type); // 查询好友/用户申请(申请表)-√ 61 | bool QueryApplyList(Json::Value &outValue, const int &usrId); // 查询申请列表(申请表)-√ 62 | 63 | bool AddFriend(const int &usrId, const int &frdId); // 添加好友(好友表)-√ 64 | bool DeleteFriend(const int &usrId, const int &frdId); // 删除好友(好友表)-√ 65 | bool QueryFriendRelation(std::string &outBuildTime, const int &usrId, const int &frdId); // 查询好友关系(好友表)-√ 66 | bool QueryFriendList(Json::Value &outValue, const int &usrId); // 查询好友列表(好友表)-√ 67 | 68 | bool QueryGroup(const int &grpId); // 查询群(群表)-√ 69 | bool QueryGroupLeader(const int &grpId, int &outLeaderId); // 查群主(群表)-√ 70 | bool QueryGroupInfo(Json::Value &outValue, const int &grpId); // 查询群信息(群表)-√ 71 | bool QueryGroupMember(Json::Value &outValue, const int &grpId); // 查询群成员(群表)-√ 72 | bool AddGroup(const int &leaderId, const int &grpId, const int &grpPicture, const std::string &groupName, 73 | const std::string &members, const int &adminCount, const int &memberCount); // 增加群(群表)-√ 74 | bool DeleteGroup(const int &grpId); // 删群(群表)-√ 75 | bool UpdateGroupMember(const int &usrId, const int &grpId, const std::string &members); // 更新群成员(群表)-√ 76 | bool UpdateGroupInfo(const int &grpId, const std::string &groupNickname, const std::string groupIntro); // 修改群消息(群表)-√ 77 | bool UpdateGroupPicture(const int &grpId, const int &picture); // 更新群头像(群表)-√ 78 | 79 | bool AddUserInGroup(const int &usrId, const int &grpId, const std::string &identify); // 增加用户进群(用户进群表)-√ 80 | bool DeleteUserInGroup(const int &usrId, const int &grpId); // 删除用户进群数据(用户进群表)-√ 81 | bool UpdateUserGroupNickname(const int &usrId, const int &grpId, const std::string &userGroupNickname); // 修改用户的群昵称(用户进群表)-√ 82 | bool QueryUserGroupNickname(const int &usrId, const int &grpId, std::string &userGroupNickname); // 查看用户的群昵称(用户进群表)-√ 83 | bool QueryGroupRelation(Json::Value &outValue, const int &usrId, const int &grpId); // 查询群关系(用户进群表)-√ 84 | bool QueryGroupList(Json::Value &outValue, const int &usrId); // 查询群列表(用户进群表)-√ 85 | 86 | bool AddOfflineMsg(const int &type, Json::Value &rootObj, int memberId = 0); // 增加聊天记录(离线消息表)- 87 | bool DeleteOfflineMsg(const int &usrId); // 删除好友聊天记录(离线消息表)-√ 88 | bool QueryOfflineMsg(Json::Value &outValue, const int &sender, const int &receiver, const int &groupId, const int &startIndex); // 查询聊天信息(历史消息表)-! 89 | 90 | bool AddChatObject(const int &usrId, const int &sideId, const int &type); // 增加聊天对象(聊天对象表)-√ 91 | bool DeleteChatObject(const int &usrId, const int &sideId, const int &type); // 删除聊天对象(聊天对象表)-√ 92 | bool QueryChatObject(const int &type, const int &usrId, const int &sideId); 93 | bool QueryChatObjectList(Json::Value &outValue, const int &usrId); // 查询聊天对象(聊天对象表)-√ 94 | bool QueryChatObjectIDList(Json::Value &outValue, const int &usrId); // 查询聊天对象ID(聊天对象表)-√ 95 | 96 | bool UpdateConfig(const int &usrId); // 更新用户配置(配置表)- 97 | bool QueryConfig(Json::Value &outValue, const int &usrId); // 查询用户配置(配置表)- 98 | 99 | private: 100 | DataBase(); 101 | DataBase(const DataBase &) = delete; 102 | DataBase &operator=(const DataBase &) = delete; 103 | ~DataBase(){}; 104 | 105 | void initGroupMap(); // 初始化群map 106 | 107 | static DataBase *instance; 108 | MYSQL *mysql; 109 | 110 | std::mutex mtx; 111 | 112 | // std::unique_lock guard(mtx); 113 | // std::unique_lock unique(mtx); 114 | // pthread_rwlock_t rwLock; 115 | // MYSQL_ROW row; 116 | // MYSQL_RES *result; 117 | // MYSQL_FIELD *field; 118 | }; 119 | 120 | #endif 121 | -------------------------------------------------------------------------------- /Server-EChat/include/Server.h: -------------------------------------------------------------------------------- 1 | #ifndef __SERVER__H 2 | #define __SERVER__H 3 | 4 | #include 5 | using std::cin; 6 | using std::cout; 7 | using std::endl; 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | #include "json/json.h" 28 | #include "DataBase.h" 29 | 30 | #define DEFAULT_PORT 7799 // 默认端口 31 | #define BUFFER_SIZE 1024 // 最大缓冲区大小 32 | #define EVENTS_SIZE 1024 // 最大事件数 33 | #define TIMEOUT -1 // 指定最大等待时间(毫秒),-1就是无限 34 | 35 | #define PACK_HEAD_LENGTH sizeof(int) 36 | 37 | typedef struct FDInfo 38 | { 39 | int fd; 40 | int ep_fd; 41 | } FDInfo; 42 | 43 | // extern bool AddWorkFd(const int &fd); 44 | // extern void DeleteWorkFd(const int &fd); 45 | // extern bool QueryWorkFd(const int &fd); 46 | 47 | extern void AddOnlineFd(const int &usrId, const int &fd); 48 | extern void DeleteOnlineFd(const int &fd); 49 | extern void DeleteUser(const int &usrId); 50 | extern int GetOnlineFd(const int &usrId); 51 | extern bool GetOnlineState(const int &usrId); 52 | extern void ShowAllFd(); 53 | 54 | class Server 55 | { 56 | public: 57 | Server(); 58 | ~Server(); 59 | 60 | void Start(); 61 | 62 | private: 63 | void CreateSocket(); // 创建套接字 64 | void CreateEpoll(); // 创建epoll池 65 | void HandleEvent(); // 处理事件 66 | 67 | static void *ThreadToConnect(void *arg); // 处理客户端连接 68 | static void *ThreadToCommunicate(void *arg); // 处理客户端通信 69 | 70 | static int Pack(const std::string &data, char **packData); // 封包 71 | static int Unpack(const int &fd, char **data); // 拆包 72 | static void HandleRequest(const int &fd, const std::string &data); // 处理请求 73 | static void Send(const int &fd, const std::string &json); // 发送数据 74 | 75 | private: 76 | int listenFd; // 用于监听的文件描述符 77 | int epollFd; // epoll实例的文件描述符 78 | struct epoll_event events[EVENTS_SIZE]; // 事件集合 79 | 80 | bool runState; // 服务器运行状态 81 | bool dbState; // 数据库连接状态 82 | 83 | static DataBase *db; // db工具 84 | }; 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /Server-EChat/json/allocator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_ALLOCATOR_H_INCLUDED 7 | #define JSON_ALLOCATOR_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #pragma pack(push) 13 | #pragma pack() 14 | 15 | namespace Json { 16 | template class SecureAllocator { 17 | public: 18 | // Type definitions 19 | using value_type = T; 20 | using pointer = T*; 21 | using const_pointer = const T*; 22 | using reference = T&; 23 | using const_reference = const T&; 24 | using size_type = std::size_t; 25 | using difference_type = std::ptrdiff_t; 26 | 27 | /** 28 | * Allocate memory for N items using the standard allocator. 29 | */ 30 | pointer allocate(size_type n) { 31 | // allocate using "global operator new" 32 | return static_cast(::operator new(n * sizeof(T))); 33 | } 34 | 35 | /** 36 | * Release memory which was allocated for N items at pointer P. 37 | * 38 | * The memory block is filled with zeroes before being released. 39 | */ 40 | void deallocate(pointer p, size_type n) { 41 | // memset_s is used because memset may be optimized away by the compiler 42 | memset_s(p, n * sizeof(T), 0, n * sizeof(T)); 43 | // free using "global operator delete" 44 | ::operator delete(p); 45 | } 46 | 47 | /** 48 | * Construct an item in-place at pointer P. 49 | */ 50 | template void construct(pointer p, Args&&... args) { 51 | // construct using "placement new" and "perfect forwarding" 52 | ::new (static_cast(p)) T(std::forward(args)...); 53 | } 54 | 55 | size_type max_size() const { return size_t(-1) / sizeof(T); } 56 | 57 | pointer address(reference x) const { return std::addressof(x); } 58 | 59 | const_pointer address(const_reference x) const { return std::addressof(x); } 60 | 61 | /** 62 | * Destroy an item in-place at pointer P. 63 | */ 64 | void destroy(pointer p) { 65 | // destroy using "explicit destructor" 66 | p->~T(); 67 | } 68 | 69 | // Boilerplate 70 | SecureAllocator() {} 71 | template SecureAllocator(const SecureAllocator&) {} 72 | template struct rebind { using other = SecureAllocator; }; 73 | }; 74 | 75 | template 76 | bool operator==(const SecureAllocator&, const SecureAllocator&) { 77 | return true; 78 | } 79 | 80 | template 81 | bool operator!=(const SecureAllocator&, const SecureAllocator&) { 82 | return false; 83 | } 84 | 85 | } // namespace Json 86 | 87 | #pragma pack(pop) 88 | 89 | #endif // JSON_ALLOCATOR_H_INCLUDED 90 | -------------------------------------------------------------------------------- /Server-EChat/json/assertions.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_ASSERTIONS_H_INCLUDED 7 | #define JSON_ASSERTIONS_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #if !defined(JSON_IS_AMALGAMATION) 13 | #include "config.h" 14 | #endif // if !defined(JSON_IS_AMALGAMATION) 15 | 16 | /** It should not be possible for a maliciously designed file to 17 | * cause an abort() or seg-fault, so these macros are used only 18 | * for pre-condition violations and internal logic errors. 19 | */ 20 | #if JSON_USE_EXCEPTION 21 | 22 | // @todo <= add detail about condition in exception 23 | #define JSON_ASSERT(condition) \ 24 | do { \ 25 | if (!(condition)) { \ 26 | Json::throwLogicError("assert json failed"); \ 27 | } \ 28 | } while (0) 29 | 30 | #define JSON_FAIL_MESSAGE(message) \ 31 | do { \ 32 | OStringStream oss; \ 33 | oss << message; \ 34 | Json::throwLogicError(oss.str()); \ 35 | abort(); \ 36 | } while (0) 37 | 38 | #else // JSON_USE_EXCEPTION 39 | 40 | #define JSON_ASSERT(condition) assert(condition) 41 | 42 | // The call to assert() will show the failure message in debug builds. In 43 | // release builds we abort, for a core-dump or debugger. 44 | #define JSON_FAIL_MESSAGE(message) \ 45 | { \ 46 | OStringStream oss; \ 47 | oss << message; \ 48 | assert(false && oss.str().c_str()); \ 49 | abort(); \ 50 | } 51 | 52 | #endif 53 | 54 | #define JSON_ASSERT_MESSAGE(condition, message) \ 55 | do { \ 56 | if (!(condition)) { \ 57 | JSON_FAIL_MESSAGE(message); \ 58 | } \ 59 | } while (0) 60 | 61 | #endif // JSON_ASSERTIONS_H_INCLUDED 62 | -------------------------------------------------------------------------------- /Server-EChat/json/config.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_CONFIG_H_INCLUDED 7 | #define JSON_CONFIG_H_INCLUDED 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | // If non-zero, the library uses exceptions to report bad input instead of C 18 | // assertion macros. The default is to use exceptions. 19 | #ifndef JSON_USE_EXCEPTION 20 | #define JSON_USE_EXCEPTION 1 21 | #endif 22 | 23 | // Temporary, tracked for removal with issue #982. 24 | #ifndef JSON_USE_NULLREF 25 | #define JSON_USE_NULLREF 1 26 | #endif 27 | 28 | /// If defined, indicates that the source file is amalgamated 29 | /// to prevent private header inclusion. 30 | /// Remarks: it is automatically defined in the generated amalgamated header. 31 | // #define JSON_IS_AMALGAMATION 32 | 33 | // Export macros for DLL visibility 34 | #if defined(JSON_DLL_BUILD) 35 | #if defined(_MSC_VER) || defined(__MINGW32__) 36 | #define JSON_API __declspec(dllexport) 37 | #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 38 | #elif defined(__GNUC__) || defined(__clang__) 39 | #define JSON_API __attribute__((visibility("default"))) 40 | #endif // if defined(_MSC_VER) 41 | 42 | #elif defined(JSON_DLL) 43 | #if defined(_MSC_VER) || defined(__MINGW32__) 44 | #define JSON_API __declspec(dllimport) 45 | #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 46 | #endif // if defined(_MSC_VER) 47 | #endif // ifdef JSON_DLL_BUILD 48 | 49 | #if !defined(JSON_API) 50 | #define JSON_API 51 | #endif 52 | 53 | #if defined(_MSC_VER) && _MSC_VER < 1800 54 | #error \ 55 | "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities" 56 | #endif 57 | 58 | #if defined(_MSC_VER) && _MSC_VER < 1900 59 | // As recommended at 60 | // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 61 | extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size, 62 | const char* format, ...); 63 | #define jsoncpp_snprintf msvc_pre1900_c99_snprintf 64 | #else 65 | #define jsoncpp_snprintf std::snprintf 66 | #endif 67 | 68 | // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for 69 | // integer 70 | // Storages, and 64 bits integer support is disabled. 71 | // #define JSON_NO_INT64 1 72 | 73 | // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools. 74 | // C++11 should be used directly in JSONCPP. 75 | #define JSONCPP_OVERRIDE override 76 | 77 | #ifdef __clang__ 78 | #if __has_extension(attribute_deprecated_with_message) 79 | #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) 80 | #endif 81 | #elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc) 82 | #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) 83 | #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) 84 | #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) 85 | #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) 86 | #endif // GNUC version 87 | #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates 88 | // MSVC) 89 | #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) 90 | #endif // __clang__ || __GNUC__ || _MSC_VER 91 | 92 | #if !defined(JSONCPP_DEPRECATED) 93 | #define JSONCPP_DEPRECATED(message) 94 | #endif // if !defined(JSONCPP_DEPRECATED) 95 | 96 | #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6)) 97 | #define JSON_USE_INT64_DOUBLE_CONVERSION 1 98 | #endif 99 | 100 | #if !defined(JSON_IS_AMALGAMATION) 101 | 102 | #include "allocator.h" 103 | #include "version.h" 104 | 105 | #endif // if !defined(JSON_IS_AMALGAMATION) 106 | 107 | namespace Json { 108 | using Int = int; 109 | using UInt = unsigned int; 110 | #if defined(JSON_NO_INT64) 111 | using LargestInt = int; 112 | using LargestUInt = unsigned int; 113 | #undef JSON_HAS_INT64 114 | #else // if defined(JSON_NO_INT64) 115 | // For Microsoft Visual use specific types as long long is not supported 116 | #if defined(_MSC_VER) // Microsoft Visual Studio 117 | using Int64 = __int64; 118 | using UInt64 = unsigned __int64; 119 | #else // if defined(_MSC_VER) // Other platforms, use long long 120 | using Int64 = int64_t; 121 | using UInt64 = uint64_t; 122 | #endif // if defined(_MSC_VER) 123 | using LargestInt = Int64; 124 | using LargestUInt = UInt64; 125 | #define JSON_HAS_INT64 126 | #endif // if defined(JSON_NO_INT64) 127 | 128 | template 129 | using Allocator = 130 | typename std::conditional, 131 | std::allocator>::type; 132 | using String = std::basic_string, Allocator>; 133 | using IStringStream = 134 | std::basic_istringstream; 136 | using OStringStream = 137 | std::basic_ostringstream; 139 | using IStream = std::istream; 140 | using OStream = std::ostream; 141 | } // namespace Json 142 | 143 | // Legacy names (formerly macros). 144 | using JSONCPP_STRING = Json::String; 145 | using JSONCPP_ISTRINGSTREAM = Json::IStringStream; 146 | using JSONCPP_OSTRINGSTREAM = Json::OStringStream; 147 | using JSONCPP_ISTREAM = Json::IStream; 148 | using JSONCPP_OSTREAM = Json::OStream; 149 | 150 | #endif // JSON_CONFIG_H_INCLUDED 151 | -------------------------------------------------------------------------------- /Server-EChat/json/forwards.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FORWARDS_H_INCLUDED 7 | #define JSON_FORWARDS_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "config.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace Json { 14 | 15 | // writer.h 16 | class StreamWriter; 17 | class StreamWriterBuilder; 18 | class Writer; 19 | class FastWriter; 20 | class StyledWriter; 21 | class StyledStreamWriter; 22 | 23 | // reader.h 24 | class Reader; 25 | class CharReader; 26 | class CharReaderBuilder; 27 | 28 | // json_features.h 29 | class Features; 30 | 31 | // value.h 32 | using ArrayIndex = unsigned int; 33 | class StaticString; 34 | class Path; 35 | class PathArgument; 36 | class Value; 37 | class ValueIteratorBase; 38 | class ValueIterator; 39 | class ValueConstIterator; 40 | 41 | } // namespace Json 42 | 43 | #endif // JSON_FORWARDS_H_INCLUDED 44 | -------------------------------------------------------------------------------- /Server-EChat/json/json.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_JSON_H_INCLUDED 7 | #define JSON_JSON_H_INCLUDED 8 | 9 | #include "config.h" 10 | #include "json_features.h" 11 | #include "reader.h" 12 | #include "value.h" 13 | #include "writer.h" 14 | 15 | #endif // JSON_JSON_H_INCLUDED 16 | -------------------------------------------------------------------------------- /Server-EChat/json/json_features.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FEATURES_H_INCLUDED 7 | #define JSON_FEATURES_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "forwards.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | #pragma pack(push) 14 | #pragma pack() 15 | 16 | namespace Json { 17 | 18 | /** \brief Configuration passed to reader and writer. 19 | * This configuration object can be used to force the Reader or Writer 20 | * to behave in a standard conforming way. 21 | */ 22 | class JSON_API Features { 23 | public: 24 | /** \brief A configuration that allows all features and assumes all strings 25 | * are UTF-8. 26 | * - C & C++ comments are allowed 27 | * - Root object can be any JSON value 28 | * - Assumes Value strings are encoded in UTF-8 29 | */ 30 | static Features all(); 31 | 32 | /** \brief A configuration that is strictly compatible with the JSON 33 | * specification. 34 | * - Comments are forbidden. 35 | * - Root object must be either an array or an object value. 36 | * - Assumes Value strings are encoded in UTF-8 37 | */ 38 | static Features strictMode(); 39 | 40 | /** \brief Initialize the configuration like JsonConfig::allFeatures; 41 | */ 42 | Features(); 43 | 44 | /// \c true if comments are allowed. Default: \c true. 45 | bool allowComments_{true}; 46 | 47 | /// \c true if root must be either an array or an object value. Default: \c 48 | /// false. 49 | bool strictRoot_{false}; 50 | 51 | /// \c true if dropped null placeholders are allowed. Default: \c false. 52 | bool allowDroppedNullPlaceholders_{false}; 53 | 54 | /// \c true if numeric object key are allowed. Default: \c false. 55 | bool allowNumericKeys_{false}; 56 | }; 57 | 58 | } // namespace Json 59 | 60 | #pragma pack(pop) 61 | 62 | #endif // JSON_FEATURES_H_INCLUDED 63 | -------------------------------------------------------------------------------- /Server-EChat/json/version.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_VERSION_H_INCLUDED 2 | #define JSON_VERSION_H_INCLUDED 3 | 4 | // Note: version must be updated in three places when doing a release. This 5 | // annoying process ensures that amalgamate, CMake, and meson all report the 6 | // correct version. 7 | // 1. /meson.build 8 | // 2. /include/json/version.h 9 | // 3. /CMakeLists.txt 10 | // IMPORTANT: also update the SOVERSION!! 11 | 12 | #define JSONCPP_VERSION_STRING "1.9.5" 13 | #define JSONCPP_VERSION_MAJOR 1 14 | #define JSONCPP_VERSION_MINOR 9 15 | #define JSONCPP_VERSION_PATCH 5 16 | #define JSONCPP_VERSION_QUALIFIER 17 | #define JSONCPP_VERSION_HEXA \ 18 | ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ 19 | (JSONCPP_VERSION_PATCH << 8)) 20 | 21 | #ifdef JSONCPP_USING_SECURE_MEMORY 22 | #undef JSONCPP_USING_SECURE_MEMORY 23 | #endif 24 | #define JSONCPP_USING_SECURE_MEMORY 0 25 | // If non-zero, the library zeroes any memory that it has allocated before 26 | // it frees its memory. 27 | 28 | #endif // JSON_VERSION_H_INCLUDED 29 | -------------------------------------------------------------------------------- /Server-EChat/lib/libjsoncpp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/Server-EChat/lib/libjsoncpp.a -------------------------------------------------------------------------------- /Server-EChat/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Server.h" 2 | 3 | int main() 4 | { 5 | Server server; 6 | server.Start(); 7 | 8 | return 0; 9 | } -------------------------------------------------------------------------------- /Server-EChat/mysql-sql/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | 1.创建数据库 3 | create database echat; 4 | 5 | 2.使用已创建的数据库 6 | use echat; 7 | 8 | 3.设置编码 9 | set names utf8; 10 | 11 | 4.导入备份数据库 12 | source /[自己的路径].../mysql-sql/structure.sql 13 | -------------------------------------------------------------------------------- /Server-EChat/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | aux_source_directory(. DIR_SUB_SRCS) 3 | 4 | add_library(echatlib STATIC ${DIR_SUB_SRCS}) # STATIC SHARED 5 | 6 | # 使用pthread多线程 7 | find_package(Threads REQUIRED) 8 | target_link_libraries (echatlib ${CMAKE_THREAD_LIBS_INIT}) 9 | 10 | # 使用MySQL数据库 11 | set(mysql_lib mysqlclient) 12 | target_link_libraries(echatlib ${mysql_lib}) 13 | 14 | # 使用jsoncpp 15 | set(jsoncpp_lib ${PROJECT_SOURCE_DIR}/lib/libjsoncpp.a) 16 | target_link_libraries(echatlib ${jsoncpp_lib}) 17 | 18 | -------------------------------------------------------------------------------- /Server-EChat/src/FdTool.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | using std::cin; 4 | using std::cout; 5 | using std::endl; 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | // // 12 | // std::vector workFd; 13 | 14 | // void AddWorkFd(const int &fd) 15 | // { 16 | // workFd.push_back(fd); 17 | // } 18 | 19 | // void DeleteWorkFd(const int &fd) 20 | // { 21 | // for (auto it = workFd.begin(); it != workFd.end(); ++it) 22 | // { 23 | // if (fd == *it) 24 | // { 25 | // workFd.erase(it); 26 | // break; 27 | // } 28 | // } 29 | // } 30 | 31 | // bool QueryWorkFd(const int &fd) 32 | // { 33 | // for (auto it = workFd.begin(); it != workFd.end(); ++it) 34 | // { 35 | // if (fd == *it) 36 | // return true; 37 | // } 38 | // return false; 39 | // } 40 | 41 | // 在线用户 42 | std::map onlineFds; // id - fd 43 | 44 | // 群成员 45 | std::map> groups; // id - 群成员 46 | 47 | // 添加在线用户 48 | void AddOnlineFd(const int &usrId, const int &fd) 49 | { 50 | // cout << "用户" << usrId << "上线 fd=" << fd << endl; 51 | onlineFds.insert(std::make_pair(usrId, fd)); 52 | } 53 | 54 | // 删除在线用户 55 | void DeleteOnlineFd(const int &fd) 56 | { 57 | int usrId = -1; 58 | for (auto it = onlineFds.begin(); it != onlineFds.end(); ++it) 59 | { 60 | if (it->second != fd) 61 | continue; 62 | // cout << "用户" << it->first << "下线 fd=" << fd << endl; 63 | onlineFds.erase(it->first); 64 | } 65 | } 66 | 67 | void DeleteUser(const int &userId) 68 | { 69 | onlineFds.erase(userId); 70 | } 71 | 72 | // 获取在线用户fd 73 | int GetOnlineFd(const int &usrId) 74 | { 75 | auto it = onlineFds.find(usrId); 76 | if (it != onlineFds.end()) 77 | return it->second; 78 | return -1; 79 | } 80 | 81 | bool GetOnlineState(const int &usrId) 82 | { 83 | auto it = onlineFds.find(usrId); 84 | if (it != onlineFds.end()) 85 | return true; 86 | return false; 87 | } 88 | 89 | void ShowAllFd() 90 | { 91 | for (auto it = onlineFds.begin(); it != onlineFds.end(); ++it) 92 | { 93 | cout << "用户" << it->first << " fd=" << it->second << endl; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /Server-EChat/test/client.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() 8 | { 9 | // 1. 创建通信的套接字 10 | int fd = socket(AF_INET, SOCK_STREAM, 0); 11 | if (fd == -1) 12 | { 13 | perror("socket error"); 14 | exit(0); 15 | } 16 | 17 | // 2. 连接服务器 18 | struct sockaddr_in addr; 19 | addr.sin_family = AF_INET; 20 | addr.sin_port = htons(9977); // 大端端口 21 | // 81.68.113.233 22 | inet_pton(AF_INET, "10.0.4.2", &addr.sin_addr.s_addr); 23 | 24 | int ret = connect(fd, (struct sockaddr *)&addr, sizeof(addr)); 25 | if (ret == -1) 26 | { 27 | perror("connect error"); 28 | exit(0); 29 | } 30 | 31 | // 3. 和服务器端通信 32 | int num = 0; 33 | char buf[1024] = {0}; 34 | while (1) 35 | { 36 | // 发送数据 37 | sprintf(buf, "hello, world...%d\n", num++); 38 | // scanf("%s\n", buf); 39 | printf("%s\n", buf); 40 | write(fd, buf, strlen(buf) + 1); 41 | 42 | // 接收数据 43 | // memset(buf, 0, sizeof(buf)); 44 | int len = read(fd, buf, sizeof(buf)); 45 | if (len > 0) 46 | { 47 | printf("服务器: %s\n", buf); 48 | } 49 | else if (len == 0) 50 | { 51 | printf("服务器断开了连接...\n"); 52 | break; 53 | } 54 | else 55 | { 56 | perror("read"); 57 | break; 58 | } 59 | // sleep(1); 60 | } 61 | 62 | close(fd); 63 | 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /Server-EChat/编译问题.txt: -------------------------------------------------------------------------------- 1 | 2 | 问题:json/json.h:没有这样的文件或目录 3 | 4 | 方法一:拷贝json文件夹文件至系统头文件处 5 | sudo cp -r /home/[你的文件夹路径]/json /usr/include 6 | 7 | 8 | 方法二:安装jsoncpp,此时json里面的文件可有可无 9 | sudo apt-get install libjsoncpp-dev(XXX install libjsoncpp-dev) 10 | sudo ln -s /usr/include/jsoncpp/json/ /usr/include/json 11 | 12 | 13 | 14 | 问题:如何编译jsoncpp(lib文件夹里面有编译好的,也无需再次编译) 15 | github:https://github.com/open-source-parsers/jsoncpp 16 | 17 | 18 | 步骤如下(注意此时你已经有了jsoncpp文件夹以及其子目录...): 19 | 20 | 1.进入目录 21 | cd jsoncpp 22 | 23 | 2.创建编译目录并进入 24 | mkdir -p build/debug 25 | cd ./build/debug/ 26 | 27 | 3.执行cmake 28 | cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_SHARED_LIBS=OFF -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=../../lib -G "Unix Makefiles" ../../ 29 | 30 | 4.编译 31 | make 32 | 33 | 5.回到项目根目录查看编译结果 34 | cd ../.. && tree lib 35 | 36 | 6.会看到一个libjsoncpp.a库,编译成功 37 | -------------------------------------------------------------------------------- /常见问题(必看).txt: -------------------------------------------------------------------------------- 1 | 1.客户端总是注册失败? 2 | 这里的id都是来自表中的,我是创建了一个id表,维护着它,但是用户注销id回收没搞,也没有id不够用的情况下的扩增操作。 3 | 两种解决方法哈: 4 | ① 改注册代码,不是从数据库拿,自己随机生成?再去判断; 5 | ② 使用GenerateDiffID函数(在DataBase.cpp的125行)向ec_new_ids表插入一些id就行, 6 | 调用的话可以在Server.cpp中的Start函数最后调用就行,根据返回值判断是否执行完成即可, 7 | 因为这里是生成一个插一个,num值大的话执行慢很正常的(我当时20多万好像是1h不到)。 8 | 9 | -------------------------------------------------------------------------------- /部分截图/md/文件管理模块图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/md/文件管理模块图.png -------------------------------------------------------------------------------- /部分截图/md/消息收发功能模块图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/md/消息收发功能模块图.png -------------------------------------------------------------------------------- /部分截图/md/用户配置功能模块图(图中为已实现的).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/md/用户配置功能模块图(图中为已实现的).png -------------------------------------------------------------------------------- /部分截图/md/登录注册模块处理流程图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/md/登录注册模块处理流程图.png -------------------------------------------------------------------------------- /部分截图/md/联系人管理模块图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/md/联系人管理模块图.png -------------------------------------------------------------------------------- /部分截图/个人和好友信息展示效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/个人和好友信息展示效果图.png -------------------------------------------------------------------------------- /部分截图/创建群聊效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/创建群聊效果图.png -------------------------------------------------------------------------------- /部分截图/发送图片效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/发送图片效果图.png -------------------------------------------------------------------------------- /部分截图/好友消息收发界面效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/好友消息收发界面效果图.png -------------------------------------------------------------------------------- /部分截图/好友申请列表效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/好友申请列表效果图.png -------------------------------------------------------------------------------- /部分截图/用户配置界面图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/用户配置界面图.png -------------------------------------------------------------------------------- /部分截图/系统登录界面效果图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swansfought/EChat-Qt5/c4c2a208b3b26e66e3aad3e8e8cbb5a450ffd557/部分截图/系统登录界面效果图.png --------------------------------------------------------------------------------