├── .clang-format ├── .gitignore ├── 3rdparty └── framelesshelper │ ├── bin │ ├── debug │ │ ├── FramelessHelperCore64d.dll │ │ ├── FramelessHelperCore64d.pdb │ │ ├── FramelessHelperQuick64d.dll │ │ ├── FramelessHelperQuick64d.pdb │ │ ├── FramelessHelperWidgets64d.dll │ │ └── FramelessHelperWidgets64d.pdb │ └── release │ │ ├── FramelessHelperCore64.dll │ │ ├── FramelessHelperCore64.pdb │ │ ├── FramelessHelperQuick64.dll │ │ ├── FramelessHelperQuick64.pdb │ │ ├── FramelessHelperWidgets64.dll │ │ └── FramelessHelperWidgets64.pdb │ ├── include │ └── FramelessHelper │ │ ├── Core │ │ ├── ChromePalette │ │ ├── FramelessHelper_Win │ │ ├── FramelessHelper_Windows │ │ ├── FramelessManager │ │ ├── Global │ │ ├── MicaMaterial │ │ ├── Utils │ │ ├── WindowBorderPainter │ │ ├── chromepalette.h │ │ ├── framelesshelper.config │ │ ├── framelesshelper.version │ │ ├── framelesshelper_win.h │ │ ├── framelesshelper_windows.h │ │ ├── framelesshelpercore_global.h │ │ ├── framelessmanager.h │ │ ├── micamaterial.h │ │ ├── private │ │ │ ├── chromepalette_p.h │ │ │ ├── framelessconfig_p.h │ │ │ ├── framelesshelpercore_global_p.h │ │ │ ├── framelessmanager_p.h │ │ │ ├── micamaterial_p.h │ │ │ ├── registrykey_p.h │ │ │ ├── scopeguard_p.h │ │ │ ├── sysapiloader_p.h │ │ │ ├── versionnumber_p.h │ │ │ ├── windowborderpainter_p.h │ │ │ └── winverhelper_p.h │ │ ├── utils.h │ │ └── windowborderpainter.h │ │ ├── Quick │ │ ├── FramelessQuickHelper │ │ ├── FramelessQuickModule │ │ ├── FramelessQuickUtils │ │ ├── Global │ │ ├── QuickChromePalette │ │ ├── QuickMicaMaterial │ │ ├── QuickWindowBorder │ │ ├── framelesshelperquick_global.h │ │ ├── framelessquickhelper.h │ │ ├── framelessquickmodule.h │ │ ├── framelessquickutils.h │ │ ├── private │ │ │ ├── framelessquickapplicationwindow_p.h │ │ │ ├── framelessquickapplicationwindow_p_p.h │ │ │ ├── framelessquickhelper_p.h │ │ │ ├── framelessquickwindow_p.h │ │ │ ├── framelessquickwindow_p_p.h │ │ │ ├── quickimageitem_p.h │ │ │ ├── quickmicamaterial_p.h │ │ │ ├── quickstandardsystembutton_p.h │ │ │ ├── quickstandardtitlebar_p.h │ │ │ └── quickwindowborder_p.h │ │ ├── quickchromepalette.h │ │ ├── quickmicamaterial.h │ │ └── quickwindowborder.h │ │ └── Widgets │ │ ├── FramelessDialog │ │ ├── FramelessMainWindow │ │ ├── FramelessWidget │ │ ├── FramelessWidgetsHelper │ │ ├── Global │ │ ├── StandardSystemButton │ │ ├── StandardTitleBar │ │ ├── framelessdialog.h │ │ ├── framelesshelperwidgets_global.h │ │ ├── framelessmainwindow.h │ │ ├── framelesswidget.h │ │ ├── framelesswidgetshelper.h │ │ ├── private │ │ ├── framelessdialog_p.h │ │ ├── framelessmainwindow_p.h │ │ ├── framelesswidget_p.h │ │ ├── framelesswidgetshelper_p.h │ │ ├── standardsystembutton_p.h │ │ ├── standardtitlebar_p.h │ │ └── widgetssharedhelper_p.h │ │ ├── standardsystembutton.h │ │ └── standardtitlebar.h │ ├── lib │ ├── debug │ │ ├── FramelessHelperCore64d.lib │ │ ├── FramelessHelperQuick64d.lib │ │ └── FramelessHelperWidgets64d.lib │ └── release │ │ ├── FramelessHelperCore64.lib │ │ ├── FramelessHelperQuick64.lib │ │ └── FramelessHelperWidgets64.lib │ ├── qml │ └── org │ │ └── wangwenx190 │ │ └── FramelessHelper │ │ ├── FramelessHelperQuickplugin.dll │ │ ├── FramelessHelperQuickplugind.dll │ │ ├── plugins.qmltypes │ │ └── qmldir │ └── share │ └── FramelessHelper.props ├── CONTRIBUTING.md ├── Client ├── App.cpp ├── ApplyFriendInputInfoWnd.cpp ├── ApplyFriendInputInfoWnd.h ├── ApplyFriendNextWnd.cpp ├── ApplyFriendNextWnd.h ├── ApplyFriendWaitInfoWnd.cpp ├── ApplyFriendWaitInfoWnd.h ├── ChatFileInnerWnd.cpp ├── ChatFileInnerWnd.h ├── ChatFileOuterWnd.cpp ├── ChatFileOuterWnd.h ├── ChatMsgWnd.cpp ├── ChatMsgWnd.h ├── Client.aps ├── Client.rc ├── Client.vcxproj ├── Client.vcxproj.filters ├── Client.vcxproj.user ├── CommContactInfoWnd.cpp ├── CommContactInfoWnd.h ├── CommContactItemWnd.cpp ├── CommContactItemWnd.h ├── CommGroupItemWnd.cpp ├── CommGroupItemWnd.h ├── CommListWnd.cpp ├── CommListWnd.h ├── CommMsgItemWnd.cpp ├── CommMsgItemWnd.h ├── CreateGroupListItemWithSelBtnWnd.cpp ├── CreateGroupListItemWithSelBtnWnd.h ├── CreateGroupListItemWnd.cpp ├── CreateGroupListItemWnd.h ├── CreateGroupWnd.cpp ├── CreateGroupWnd.h ├── CustomListWidgetItem.cpp ├── CustomListWidgetItem.h ├── DataManager.cpp ├── DataManager.h ├── DealNewFriendsApplyItemWnd.cpp ├── DealNewFriendsApplyItemWnd.h ├── DealNewFriendsApplyWnd.cpp ├── DealNewFriendsApplyWnd.h ├── EditLabel.cpp ├── EditLabel.h ├── EmoijWnd.cpp ├── EmoijWnd.h ├── FindFriendItemWnd.cpp ├── FindFriendItemWnd.h ├── FindFriendOrGroupWnd.cpp ├── FindFriendOrGroupWnd.h ├── GroupFriendsItemWnd.cpp ├── GroupFriendsItemWnd.h ├── GroupFriendsWnd.cpp ├── GroupFriendsWnd.h ├── GroupInfoWnd.cpp ├── GroupInfoWnd.h ├── Log.cpp ├── Log.h ├── LoginRegWnd.cpp ├── LoginRegWnd.h ├── MainWnd.cpp ├── MainWnd.h ├── NetClientUtils.cpp ├── NetClientUtils.h ├── PictureToolWnd.cpp ├── PictureToolWnd.h ├── ScreenShotToolBarWnd.cpp ├── ScreenShotToolBarWnd.h ├── ScreenShotWnd.cpp ├── ScreenShotWnd.h ├── SelectGroupFriendWnd.cpp ├── SelectGroupFriendWnd.h ├── SelectMoreWnd.cpp ├── SelectMoreWnd.h ├── SelfLabel.cpp ├── SelfLabel.h ├── SelfSplit.cpp ├── SelfSplit.h ├── SelfSwitchButton.cpp ├── SelfSwitchButton.h ├── SelfTextEdit.cpp ├── SelfTextEdit.h ├── SessionToolBar.cpp ├── SessionToolBar.h ├── SessionWnd.cpp ├── SessionWnd.h ├── SettingWnd.cpp ├── SettingWnd.h ├── StyleSheetMgr.cpp ├── StyleSheetMgr.h ├── ToolWnd.cpp ├── ToolWnd.h ├── TopWnd.cpp ├── TopWnd.h ├── UserInfoWnd.cpp ├── UserInfoWnd.h ├── VoiceTelphoneWnd.cpp ├── VoiceTelphoneWnd.h ├── def.h ├── emoij │ └── emoij.txt ├── img │ ├── CheckBox-White.png │ ├── CheckBoxPressed-White.png │ ├── ChromeClose.png │ ├── ChromeMinimize.png │ ├── closeBtn_.png │ ├── closeShot.png │ ├── closeWnd.png │ ├── closeWnd1.png │ ├── contactsBtnClicked.png │ ├── contactsBtnNomal.png │ ├── copyShot.png │ ├── default.png │ ├── edit_.png │ ├── emojiBtn.png │ ├── emptybg.png │ ├── fileicon.png │ ├── groupBtnClicked.png │ ├── groupBtnNomal.png │ ├── groupHead.png │ ├── head1.png │ ├── head2.png │ ├── loading0.gif │ ├── maxBtn_.png │ ├── maxWnd.png │ ├── minBtn_.png │ ├── minWnd.png │ ├── minWnd1.png │ ├── more.png │ ├── msgBtnClicked.png │ ├── msgBtnNormal.png │ ├── normalBtn_.png │ ├── other.jpg │ ├── other.png │ ├── owner.png │ ├── raricon.png │ ├── saveShot.png │ ├── screenshotBtn.png │ ├── sendFileBtn.png │ ├── settingBtn_.png │ ├── startGroupBtn.png │ ├── tmore.png │ ├── visualTelphoneBtn.png │ ├── voiceTelphoneAccept.png │ ├── voiceTelphoneBtn.png │ ├── voiceTelphoneHeadImg.png │ ├── voiceTelphoneRefuse.png │ └── wechat.ico ├── json │ ├── CJsonObject.cpp │ ├── CJsonObject.hpp │ ├── cJSON.c │ └── cJSON.h ├── log │ ├── .gitkeep │ └── clearLog.bat ├── music │ └── callPhone.wav ├── recvFile │ └── .gitkeep └── stylesheet │ ├── LoginRegWnd.qss │ ├── QApplyFriendInputInfoWnd.qss │ ├── QApplyFriendNextWnd.qss │ ├── QChatFileInnerWnd.qss │ ├── QCommContactInfo.qss │ ├── QCommListWnd.qss │ ├── QCreateGroupWnd.qss │ ├── QDealNewFriendsApplyWnd.qss │ ├── QFindFriendItemWnd.qss │ ├── QGroupInfoWnd.qss │ ├── QMainWnd.qss │ ├── QPictureToolWnd.qss │ ├── QSelectAddGroupOrAddFriendWnd.qss │ ├── QSessionWnd.qss │ ├── QSettingWnd.qss │ ├── QUserInfoWnd.qss │ ├── wechat.dark.qss │ └── wechat.qss ├── LICENSE ├── README.md ├── Server ├── chatserver.exe ├── gateserver.exe ├── hv.dll ├── json.dll ├── linkserver.exe ├── loginserver.exe ├── msvcp140.dll ├── sqlite.dll ├── vcruntime140.dll └── vcruntime140_1.dll ├── WeChat.sln ├── docs ├── design │ ├── 搜索框-参考.jpg │ ├── 搜索框-参考.md │ └── 界面设计-参考.md ├── history.md ├── images │ ├── image-20220105002713210.png │ ├── image-20220105235017541.png │ ├── image-20220105235424102.png │ ├── image-20220106000145442.png │ ├── image-20220106000351862.png │ ├── image-20220106001015470.png │ ├── image-20220106001732763.png │ ├── image-20220106001929875.png │ ├── image-20220106002018904.png │ ├── image-20220119075236063.png │ ├── image-20220119075457716.png │ ├── image-20220119075644684.png │ ├── image-20220123171100114.png │ ├── image-20220123171339005.png │ ├── image-20220206232328636.png │ ├── image-20220206233144664.png │ ├── image-20220207225731078.png │ ├── image-20220207225803867.png │ ├── image-20220207225827424.png │ ├── image-20220207225853265.png │ ├── image-20220207225906500.png │ ├── image-20220207225941045.png │ ├── image-20220207230624278.png │ ├── image-20220207230717863.png │ ├── image-20220207231034344.png │ ├── image-20220207231159494.png │ ├── image-20220404113154149.png │ ├── image-20220404114218516.png │ ├── image-20220404114442147.png │ ├── image-20220406081347618.png │ ├── image-20220414224309021.png │ ├── image-20220414224447808.png │ ├── image-20220416090429678.png │ ├── image-20220417165056586.png │ ├── image-20220418085606040.png │ ├── image-20220430114558087.png │ ├── image-20220430115309411.png │ ├── image-20220430115403394.png │ ├── image-20220730230819181.png │ ├── image-20230408101649768.png │ ├── image-20230408195022397.png │ ├── image-20230408195109180.png │ ├── image-20230408195139125.png │ ├── image-20230410071533443.png │ ├── image-20230424002228889.png │ ├── image-20230527094724366.png │ ├── image-20230527094758544.png │ ├── image-20230527095046664.png │ ├── image-20230527095124569.png │ ├── image-20230527095429411.png │ ├── image-20230527095556641.png │ ├── image-20230527230714493.png │ ├── image-20230530224502776.png │ ├── image-20230530224546216.png │ ├── image-20230530224817440.png │ ├── image-20230530224919259.png │ ├── sesmsg.png │ ├── 搜索框-参考.jpg │ └── 消息框的设计.bmp └── plan │ ├── plan-2023-4.md │ └── plan-2023-5.md ├── format.bat └── format.sh /.gitignore: -------------------------------------------------------------------------------- 1 | # Build and Release Folders 2 | bin-debug/ 3 | bin-release/ 4 | [Oo]bj/ 5 | [Bb]in/ 6 | Release/ 7 | Debug/ 8 | 9 | # Other files and folders 10 | .settings/ 11 | 12 | # Executables 13 | *.swf 14 | *.air 15 | *.ipa 16 | *.apk 17 | *.vs 18 | *.exe 19 | *.obj 20 | 21 | # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` 22 | # should NOT be excluded as they contain compiler settings and other important 23 | # information for Eclipse / Flash Builder. 24 | /WeChatClient/recvFile 25 | /Package 26 | /WeChatClient/log 27 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/debug/FramelessHelperCore64d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/debug/FramelessHelperCore64d.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/debug/FramelessHelperCore64d.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/debug/FramelessHelperCore64d.pdb -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/debug/FramelessHelperQuick64d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/debug/FramelessHelperQuick64d.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/debug/FramelessHelperQuick64d.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/debug/FramelessHelperQuick64d.pdb -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/debug/FramelessHelperWidgets64d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/debug/FramelessHelperWidgets64d.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/debug/FramelessHelperWidgets64d.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/debug/FramelessHelperWidgets64d.pdb -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/release/FramelessHelperCore64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/release/FramelessHelperCore64.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/release/FramelessHelperCore64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/release/FramelessHelperCore64.pdb -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/release/FramelessHelperQuick64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/release/FramelessHelperQuick64.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/release/FramelessHelperQuick64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/release/FramelessHelperQuick64.pdb -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/release/FramelessHelperWidgets64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/release/FramelessHelperWidgets64.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/bin/release/FramelessHelperWidgets64.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/bin/release/FramelessHelperWidgets64.pdb -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/ChromePalette: -------------------------------------------------------------------------------- 1 | #include "chromepalette.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/FramelessHelper_Win: -------------------------------------------------------------------------------- 1 | #include "framelesshelper_win.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/FramelessHelper_Windows: -------------------------------------------------------------------------------- 1 | #include "framelesshelper_windows.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/FramelessManager: -------------------------------------------------------------------------------- 1 | #include "framelessmanager.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/Global: -------------------------------------------------------------------------------- 1 | #include "framelesshelpercore_global.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/MicaMaterial: -------------------------------------------------------------------------------- 1 | #include "micamaterial.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/Utils: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/WindowBorderPainter: -------------------------------------------------------------------------------- 1 | #include "windowborderpainter.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/framelesshelper.config: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | // Caution: This file is generated by CMake automatically during configure. 26 | // WARNING!!! DO NOT EDIT THIS FILE MANUALLY!!! 27 | // ALL YOUR MODIFICATIONS HERE WILL GET LOST AFTER RE-CONFIGURING!!! 28 | 29 | #pragma once 30 | 31 | #ifndef _FRAMELESSHELPER_CONFIG_INCLUDE_GUARD_ 32 | #define _FRAMELESSHELPER_CONFIG_INCLUDE_GUARD_ 33 | 34 | #define FRAMELESSHELPER_FEATURE_static_build -1 35 | #define FRAMELESSHELPER_FEATURE_widgets 1 36 | #define FRAMELESSHELPER_FEATURE_quick 1 37 | #define FRAMELESSHELPER_FEATURE_debug_output -1 38 | #define FRAMELESSHELPER_FEATURE_bundle_resource 1 39 | #define FRAMELESSHELPER_FEATURE_private_qt 1 40 | #define FRAMELESSHELPER_FEATURE_window 1 41 | #define FRAMELESSHELPER_FEATURE_titlebar 1 42 | #define FRAMELESSHELPER_FEATURE_translation 1 43 | #define FRAMELESSHELPER_FEATURE_mica_material 1 44 | #define FRAMELESSHELPER_FEATURE_border_painter 1 45 | #define FRAMELESSHELPER_FEATURE_system_button 1 46 | #define FRAMELESSHELPER_FEATURE_native_impl 1 47 | 48 | #endif // _FRAMELESSHELPER_CONFIG_INCLUDE_GUARD_ 49 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/framelesshelper_win.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #ifdef Q_OS_WINDOWS 31 | 32 | #if FRAMELESSHELPER_CONFIG(native_impl) 33 | 34 | FRAMELESSHELPER_BEGIN_NAMESPACE 35 | 36 | class FRAMELESSHELPER_CORE_API FramelessHelperWin : public QAbstractNativeEventFilter 37 | { 38 | FRAMELESSHELPER_CLASS(FramelessHelperWin) 39 | 40 | public: 41 | explicit FramelessHelperWin(); 42 | ~FramelessHelperWin() override; 43 | 44 | static void addWindow(const QObject *window); 45 | static void removeWindow(const QObject *window); 46 | 47 | Q_NODISCARD bool nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) override; 48 | }; 49 | 50 | FRAMELESSHELPER_END_NAMESPACE 51 | 52 | #endif // native_impl 53 | 54 | #endif // Q_OS_WINDOWS 55 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/framelessmanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | FRAMELESSHELPER_BEGIN_NAMESPACE 30 | 31 | class FramelessManagerPrivate; 32 | class FRAMELESSHELPER_CORE_API FramelessManager : public QObject 33 | { 34 | Q_OBJECT 35 | FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessManager) 36 | Q_PROPERTY(Global::SystemTheme systemTheme READ systemTheme WRITE setOverrideTheme NOTIFY systemThemeChanged FINAL) 37 | Q_PROPERTY(QColor systemAccentColor READ systemAccentColor NOTIFY systemThemeChanged FINAL) 38 | Q_PROPERTY(QString wallpaper READ wallpaper NOTIFY wallpaperChanged FINAL) 39 | Q_PROPERTY(Global::WallpaperAspectStyle wallpaperAspectStyle READ wallpaperAspectStyle NOTIFY wallpaperChanged FINAL) 40 | 41 | public: 42 | Q_NODISCARD static FramelessManager *instance(); 43 | 44 | Q_NODISCARD Global::SystemTheme systemTheme() const; 45 | Q_NODISCARD QColor systemAccentColor() const; 46 | Q_NODISCARD QString wallpaper() const; 47 | Q_NODISCARD Global::WallpaperAspectStyle wallpaperAspectStyle() const; 48 | 49 | public Q_SLOTS: 50 | Q_NODISCARD bool addWindow(const QObject *window, const WId windowId); 51 | Q_NODISCARD bool removeWindow(const QObject *window); 52 | void setOverrideTheme(const Global::SystemTheme theme); 53 | 54 | Q_SIGNALS: 55 | void systemThemeChanged(); 56 | void wallpaperChanged(); 57 | 58 | private: 59 | explicit FramelessManager(QObject *parent = nullptr); 60 | ~FramelessManager() override; 61 | }; 62 | 63 | FRAMELESSHELPER_END_NAMESPACE 64 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/private/framelessconfig_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | FRAMELESSHELPER_BEGIN_NAMESPACE 30 | 31 | class FRAMELESSHELPER_CORE_API FramelessConfig : public QObject 32 | { 33 | Q_OBJECT 34 | FRAMELESSHELPER_QT_CLASS(FramelessConfig) 35 | 36 | public: 37 | Q_NODISCARD static FramelessConfig *instance(); 38 | 39 | void reload(const bool force = false); 40 | 41 | void set(const Global::Option option, const bool on = true); 42 | Q_NODISCARD bool isSet(const Global::Option option) const; 43 | 44 | static void setLoadFromEnvironmentVariablesDisabled(const bool on = true); 45 | static void setLoadFromConfigurationFileDisabled(const bool on = true); 46 | 47 | private: 48 | explicit FramelessConfig(QObject *parent = nullptr); 49 | ~FramelessConfig() override; 50 | }; 51 | 52 | FRAMELESSHELPER_END_NAMESPACE 53 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/private/micamaterial_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if FRAMELESSHELPER_CONFIG(mica_material) 31 | 32 | FRAMELESSHELPER_BEGIN_NAMESPACE 33 | 34 | class MicaMaterial; 35 | class FRAMELESSHELPER_CORE_API MicaMaterialPrivate : public QObject 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_PRIVATE_QT_CLASS(MicaMaterial) 39 | 40 | public: 41 | explicit MicaMaterialPrivate(MicaMaterial *q); 42 | ~MicaMaterialPrivate() override; 43 | 44 | Q_NODISCARD static QColor systemFallbackColor(); 45 | 46 | Q_NODISCARD QPoint mapToWallpaper(const QPoint &pos) const; 47 | Q_NODISCARD QSize mapToWallpaper(const QSize &size) const; 48 | Q_NODISCARD QRect mapToWallpaper(const QRect &rect) const; 49 | 50 | Q_SLOT void maybeGenerateBlurredWallpaper(const bool force = false); 51 | Q_SLOT void updateMaterialBrush(); 52 | Q_SLOT void forceRebuildWallpaper(); 53 | 54 | void initialize(); 55 | void prepareGraphicsResources(); 56 | 57 | QColor tintColor = {}; 58 | qreal tintOpacity = qreal(0); 59 | QColor fallbackColor = {}; 60 | qreal noiseOpacity = qreal(0); 61 | bool fallbackEnabled = true; 62 | QBrush micaBrush = {}; 63 | bool initialized = false; 64 | QSize wallpaperSize = {}; 65 | }; 66 | 67 | FRAMELESSHELPER_END_NAMESPACE 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/private/windowborderpainter_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if FRAMELESSHELPER_CONFIG(border_painter) 31 | 32 | FRAMELESSHELPER_BEGIN_NAMESPACE 33 | 34 | class WindowBorderPainter; 35 | class FRAMELESSHELPER_CORE_API WindowBorderPainterPrivate : public QObject 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_PRIVATE_QT_CLASS(WindowBorderPainter) 39 | 40 | public: 41 | explicit WindowBorderPainterPrivate(WindowBorderPainter *q); 42 | ~WindowBorderPainterPrivate() override; 43 | 44 | std::optional thickness = std::nullopt; 45 | std::optional edges = std::nullopt; 46 | std::optional activeColor = std::nullopt; 47 | std::optional inactiveColor = std::nullopt; 48 | }; 49 | 50 | FRAMELESSHELPER_END_NAMESPACE 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Core/private/winverhelper_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #ifdef Q_OS_WINDOWS 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | namespace WindowsVersionHelper 34 | { 35 | 36 | #define DECL(Name) [[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin##Name##OrGreater(); 37 | 38 | DECL(2K) 39 | DECL(XP) 40 | DECL(XP64) 41 | DECL(Vista) 42 | DECL(VistaSP1) 43 | DECL(VistaSP2) 44 | DECL(7) 45 | DECL(7SP1) 46 | DECL(8) 47 | DECL(8Point1) 48 | DECL(8Point1Update1) 49 | DECL(10) 50 | DECL(10TH1) 51 | DECL(10TH2) 52 | DECL(10RS1) 53 | DECL(10RS2) 54 | DECL(10RS3) 55 | DECL(10RS4) 56 | DECL(10RS5) 57 | DECL(1019H1) 58 | DECL(1019H2) 59 | DECL(1020H1) 60 | DECL(1020H2) 61 | DECL(1021H1) 62 | DECL(1021H2) 63 | DECL(1022H2) 64 | DECL(11) 65 | DECL(1121H2) 66 | DECL(1122H2) 67 | 68 | #undef DECL 69 | 70 | } // namespace WindowsVersionHelper 71 | 72 | FRAMELESSHELPER_END_NAMESPACE 73 | 74 | #endif // Q_OS_WINDOWS 75 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/FramelessQuickHelper: -------------------------------------------------------------------------------- 1 | #include "framelessquickhelper.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/FramelessQuickModule: -------------------------------------------------------------------------------- 1 | #include "framelessquickmodule.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/FramelessQuickUtils: -------------------------------------------------------------------------------- 1 | #include "framelessquickutils.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/Global: -------------------------------------------------------------------------------- 1 | #include "framelesshelperquick_global.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/QuickChromePalette: -------------------------------------------------------------------------------- 1 | #include "quickchromepalette.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/QuickMicaMaterial: -------------------------------------------------------------------------------- 1 | #include "quickmicamaterial.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/QuickWindowBorder: -------------------------------------------------------------------------------- 1 | #include "quickwindowborder.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/framelessquickmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | QT_BEGIN_NAMESPACE 30 | class QQmlEngine; 31 | QT_END_NAMESPACE 32 | 33 | FRAMELESSHELPER_BEGIN_NAMESPACE 34 | 35 | namespace FramelessHelper::Quick 36 | { 37 | inline void registerTypes(QQmlEngine *engine) { FramelessHelperQuickRegisterTypes(engine); } 38 | } // namespace FramelessHelper::Quick 39 | 40 | FRAMELESSHELPER_END_NAMESPACE 41 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/private/framelessquickapplicationwindow_p_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if (FRAMELESSHELPER_CONFIG(private_qt) && FRAMELESSHELPER_CONFIG(window) && (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))) 30 | 31 | #include 32 | 33 | FRAMELESSHELPER_BEGIN_NAMESPACE 34 | 35 | #if FRAMELESSHELPER_CONFIG(border_painter) 36 | class QuickWindowBorder; 37 | #endif 38 | 39 | class FramelessQuickApplicationWindow; 40 | class FRAMELESSHELPER_QUICK_API FramelessQuickApplicationWindowPrivate : public QObject 41 | { 42 | Q_OBJECT 43 | FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessQuickApplicationWindow) 44 | 45 | public: 46 | explicit FramelessQuickApplicationWindowPrivate(FramelessQuickApplicationWindow *q); 47 | ~FramelessQuickApplicationWindowPrivate() override; 48 | 49 | QQuickWindow::Visibility savedVisibility = QQuickWindow::Windowed; 50 | #if FRAMELESSHELPER_CONFIG(border_painter) 51 | QuickWindowBorder *windowBorder = nullptr; 52 | #endif 53 | }; 54 | 55 | FRAMELESSHELPER_END_NAMESPACE 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/private/framelessquickwindow_p_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if (FRAMELESSHELPER_CONFIG(private_qt) && FRAMELESSHELPER_CONFIG(window)) 30 | 31 | #include 32 | 33 | FRAMELESSHELPER_BEGIN_NAMESPACE 34 | 35 | #if FRAMELESSHELPER_CONFIG(border_painter) 36 | class QuickWindowBorder; 37 | #endif 38 | 39 | class FramelessQuickWindow; 40 | class FRAMELESSHELPER_QUICK_API FramelessQuickWindowPrivate : public QObject 41 | { 42 | Q_OBJECT 43 | FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessQuickWindow) 44 | 45 | public: 46 | explicit FramelessQuickWindowPrivate(FramelessQuickWindow *q); 47 | ~FramelessQuickWindowPrivate() override; 48 | 49 | QQuickWindow::Visibility savedVisibility = QQuickWindow::Windowed; 50 | #if FRAMELESSHELPER_CONFIG(border_painter) 51 | QuickWindowBorder *windowBorder = nullptr; 52 | #endif 53 | }; 54 | 55 | FRAMELESSHELPER_END_NAMESPACE 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/private/quickimageitem_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | class FRAMELESSHELPER_QUICK_API QuickImageItem : public QQuickPaintedItem 34 | { 35 | Q_OBJECT 36 | FRAMELESSHELPER_QT_CLASS(QuickImageItem) 37 | #ifdef QML_NAMED_ELEMENT 38 | QML_NAMED_ELEMENT(ImageItem) 39 | #endif 40 | 41 | Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged FINAL) 42 | 43 | public: 44 | explicit QuickImageItem(QQuickItem *parent = nullptr); 45 | ~QuickImageItem() override; 46 | 47 | void paint(QPainter *painter) override; 48 | 49 | Q_NODISCARD QVariant source() const; 50 | void setSource(const QVariant &value); 51 | 52 | Q_SIGNALS: 53 | void sourceChanged(); 54 | 55 | protected: 56 | void classBegin() override; 57 | void componentComplete() override; 58 | 59 | private: 60 | void fromUrl(const QUrl &value, QPainter *painter) const; 61 | void fromString(const QString &value, QPainter *painter) const; 62 | void fromImage(const QImage &value, QPainter *painter) const; 63 | void fromPixmap(const QPixmap &value, QPainter *painter) const; 64 | void fromIcon(const QIcon &value, QPainter *painter) const; 65 | Q_NODISCARD QRectF paintArea() const; 66 | 67 | private: 68 | QVariant m_source = {}; 69 | }; 70 | 71 | FRAMELESSHELPER_END_NAMESPACE 72 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/private/quickmicamaterial_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if FRAMELESSHELPER_CONFIG(mica_material) 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | class MicaMaterial; 34 | 35 | class QuickMicaMaterial; 36 | class FRAMELESSHELPER_QUICK_API QuickMicaMaterialPrivate : public QObject 37 | { 38 | Q_OBJECT 39 | FRAMELESSHELPER_PRIVATE_QT_CLASS(QuickMicaMaterial) 40 | 41 | public: 42 | explicit QuickMicaMaterialPrivate(QuickMicaMaterial *q); 43 | ~QuickMicaMaterialPrivate() override; 44 | 45 | Q_SLOT void rebindWindow(); 46 | 47 | void initialize(); 48 | 49 | QMetaObject::Connection rootWindowXChangedConnection = {}; 50 | QMetaObject::Connection rootWindowYChangedConnection = {}; 51 | QMetaObject::Connection rootWindowActiveChangedConnection = {}; 52 | MicaMaterial *micaMaterial = nullptr; 53 | }; 54 | 55 | FRAMELESSHELPER_END_NAMESPACE 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/private/quickwindowborder_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if FRAMELESSHELPER_CONFIG(border_painter) 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | class WindowBorderPainter; 34 | 35 | class QuickWindowBorder; 36 | class FRAMELESSHELPER_QUICK_API QuickWindowBorderPrivate : public QObject 37 | { 38 | Q_OBJECT 39 | FRAMELESSHELPER_PRIVATE_QT_CLASS(QuickWindowBorder) 40 | 41 | public: 42 | explicit QuickWindowBorderPrivate(QuickWindowBorder *q); 43 | ~QuickWindowBorderPrivate() override; 44 | 45 | Q_SLOT void update(); 46 | 47 | void initialize(); 48 | void rebindWindow(); 49 | 50 | WindowBorderPainter *borderPainter = nullptr; 51 | QMetaObject::Connection activeChangeConnection = {}; 52 | QMetaObject::Connection visibilityChangeConnection = {}; 53 | }; 54 | 55 | FRAMELESSHELPER_END_NAMESPACE 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Quick/quickchromepalette.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #if FRAMELESSHELPER_CONFIG(titlebar) 32 | 33 | FRAMELESSHELPER_BEGIN_NAMESPACE 34 | 35 | class FRAMELESSHELPER_QUICK_API QuickChromePalette : public ChromePalette, public QQmlParserStatus 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_QT_CLASS(QuickChromePalette) 39 | Q_INTERFACES(QQmlParserStatus) 40 | #ifdef QML_ANONYMOUS 41 | QML_ANONYMOUS 42 | #endif 43 | 44 | public: 45 | explicit QuickChromePalette(QObject *parent = nullptr); 46 | ~QuickChromePalette() override; 47 | 48 | protected: 49 | void classBegin() override; 50 | void componentComplete() override; 51 | }; 52 | 53 | FRAMELESSHELPER_END_NAMESPACE 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/FramelessDialog: -------------------------------------------------------------------------------- 1 | #include "framelessdialog.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/FramelessMainWindow: -------------------------------------------------------------------------------- 1 | #include "framelessmainwindow.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/FramelessWidget: -------------------------------------------------------------------------------- 1 | #include "framelesswidget.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/FramelessWidgetsHelper: -------------------------------------------------------------------------------- 1 | #include "framelesswidgetshelper.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/Global: -------------------------------------------------------------------------------- 1 | #include "framelesshelperwidgets_global.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/StandardSystemButton: -------------------------------------------------------------------------------- 1 | #include "standardsystembutton.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/StandardTitleBar: -------------------------------------------------------------------------------- 1 | #include "standardtitlebar.h" 2 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/framelessdialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if FRAMELESSHELPER_CONFIG(window) 31 | 32 | FRAMELESSHELPER_BEGIN_NAMESPACE 33 | 34 | class FramelessDialogPrivate; 35 | class FRAMELESSHELPER_WIDGETS_API FramelessDialog : public QDialog 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessDialog) 39 | 40 | public: 41 | explicit FramelessDialog(QWidget *parent = nullptr); 42 | ~FramelessDialog() override; 43 | }; 44 | 45 | FRAMELESSHELPER_END_NAMESPACE 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/framelesshelperwidgets_global.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #ifndef FRAMELESSHELPER_WIDGETS_API 30 | # if FRAMELESSHELPER_CONFIG(static_build) 31 | # define FRAMELESSHELPER_WIDGETS_API 32 | # else 33 | # ifdef FRAMELESSHELPER_WIDGETS_LIBRARY 34 | # define FRAMELESSHELPER_WIDGETS_API Q_DECL_EXPORT 35 | # else 36 | # define FRAMELESSHELPER_WIDGETS_API Q_DECL_IMPORT 37 | # endif 38 | # endif 39 | #endif 40 | 41 | FRAMELESSHELPER_BEGIN_NAMESPACE 42 | 43 | FRAMELESSHELPER_WIDGETS_API void FramelessHelperWidgetsInitialize(); 44 | FRAMELESSHELPER_WIDGETS_API void FramelessHelperWidgetsUninitialize(); 45 | 46 | namespace FramelessHelper::Widgets 47 | { 48 | inline void initialize() { FramelessHelperWidgetsInitialize(); } 49 | inline void uninitialize() { FramelessHelperWidgetsUninitialize(); } 50 | } // namespace FramelessHelper::Widgets 51 | 52 | FRAMELESSHELPER_END_NAMESPACE 53 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/framelessmainwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if FRAMELESSHELPER_CONFIG(window) 31 | 32 | FRAMELESSHELPER_BEGIN_NAMESPACE 33 | 34 | class FramelessMainWindowPrivate; 35 | class FRAMELESSHELPER_WIDGETS_API FramelessMainWindow : public QMainWindow 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessMainWindow) 39 | Q_PROPERTY(bool hidden READ isHidden NOTIFY hiddenChanged FINAL) 40 | Q_PROPERTY(bool normal READ isNormal NOTIFY normalChanged FINAL) 41 | Q_PROPERTY(bool zoomed READ isZoomed NOTIFY zoomedChanged FINAL) 42 | 43 | public: 44 | explicit FramelessMainWindow(QWidget *parent = nullptr, const Qt::WindowFlags flags = {}); 45 | ~FramelessMainWindow() override; 46 | 47 | Q_NODISCARD bool isNormal() const; 48 | Q_NODISCARD bool isZoomed() const; 49 | 50 | public Q_SLOTS: 51 | void toggleMaximized(); 52 | void toggleFullScreen(); 53 | 54 | Q_SIGNALS: 55 | void hiddenChanged(); 56 | void normalChanged(); 57 | void zoomedChanged(); 58 | }; 59 | 60 | FRAMELESSHELPER_END_NAMESPACE 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/framelesswidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if FRAMELESSHELPER_CONFIG(window) 31 | 32 | FRAMELESSHELPER_BEGIN_NAMESPACE 33 | 34 | class FramelessWidgetPrivate; 35 | class FRAMELESSHELPER_WIDGETS_API FramelessWidget : public QWidget 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_PUBLIC_QT_CLASS(FramelessWidget) 39 | Q_PROPERTY(bool hidden READ isHidden NOTIFY hiddenChanged FINAL) 40 | Q_PROPERTY(bool normal READ isNormal NOTIFY normalChanged FINAL) 41 | Q_PROPERTY(bool zoomed READ isZoomed NOTIFY zoomedChanged FINAL) 42 | 43 | public: 44 | explicit FramelessWidget(QWidget *parent = nullptr); 45 | ~FramelessWidget() override; 46 | 47 | Q_NODISCARD bool isNormal() const; 48 | Q_NODISCARD bool isZoomed() const; 49 | 50 | public Q_SLOTS: 51 | void toggleMaximized(); 52 | void toggleFullScreen(); 53 | 54 | Q_SIGNALS: 55 | void hiddenChanged(); 56 | void normalChanged(); 57 | void zoomedChanged(); 58 | }; 59 | 60 | FRAMELESSHELPER_END_NAMESPACE 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/private/framelessdialog_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if FRAMELESSHELPER_CONFIG(window) 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | class WidgetsSharedHelper; 34 | 35 | class FramelessDialog; 36 | class FRAMELESSHELPER_WIDGETS_API FramelessDialogPrivate : public QObject 37 | { 38 | Q_OBJECT 39 | FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessDialog) 40 | 41 | public: 42 | explicit FramelessDialogPrivate(FramelessDialog *q); 43 | ~FramelessDialogPrivate() override; 44 | 45 | WidgetsSharedHelper *sharedHelper = nullptr; 46 | }; 47 | 48 | FRAMELESSHELPER_END_NAMESPACE 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/private/framelessmainwindow_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if FRAMELESSHELPER_CONFIG(window) 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | class WidgetsSharedHelper; 34 | 35 | class FramelessMainWindow; 36 | class FRAMELESSHELPER_WIDGETS_API FramelessMainWindowPrivate : public QObject 37 | { 38 | Q_OBJECT 39 | FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessMainWindow) 40 | 41 | public: 42 | explicit FramelessMainWindowPrivate(FramelessMainWindow *q); 43 | ~FramelessMainWindowPrivate() override; 44 | 45 | Qt::WindowState savedWindowState = Qt::WindowNoState; 46 | WidgetsSharedHelper *sharedHelper = nullptr; 47 | }; 48 | 49 | FRAMELESSHELPER_END_NAMESPACE 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/private/framelesswidget_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | 29 | #if FRAMELESSHELPER_CONFIG(window) 30 | 31 | FRAMELESSHELPER_BEGIN_NAMESPACE 32 | 33 | class WidgetsSharedHelper; 34 | 35 | class FramelessWidget; 36 | class FRAMELESSHELPER_WIDGETS_API FramelessWidgetPrivate : public QObject 37 | { 38 | Q_OBJECT 39 | FRAMELESSHELPER_PRIVATE_QT_CLASS(FramelessWidget) 40 | 41 | public: 42 | explicit FramelessWidgetPrivate(FramelessWidget *q); 43 | ~FramelessWidgetPrivate() override; 44 | 45 | Qt::WindowState savedWindowState = Qt::WindowNoState; 46 | WidgetsSharedHelper *sharedHelper = nullptr; 47 | }; 48 | 49 | FRAMELESSHELPER_END_NAMESPACE 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/include/FramelessHelper/Widgets/private/standardsystembutton_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | #if FRAMELESSHELPER_CONFIG(system_button) 31 | 32 | FRAMELESSHELPER_BEGIN_NAMESPACE 33 | 34 | class StandardSystemButton; 35 | class FRAMELESSHELPER_WIDGETS_API StandardSystemButtonPrivate : public QObject 36 | { 37 | Q_OBJECT 38 | FRAMELESSHELPER_PRIVATE_QT_CLASS(StandardSystemButton) 39 | 40 | public: 41 | explicit StandardSystemButtonPrivate(StandardSystemButton *q); 42 | ~StandardSystemButtonPrivate() override; 43 | 44 | Q_NODISCARD static QSize getRecommendedButtonSize(); 45 | 46 | Global::SystemButtonType buttonType = Global::SystemButtonType::Unknown; 47 | QString glyph = {}; 48 | QColor hoverColor = {}; 49 | QColor pressColor = {}; 50 | QColor normalColor = {}; 51 | QColor activeForegroundColor = {}; 52 | QColor inactiveForegroundColor = {}; 53 | bool active = false; 54 | std::optional glyphSize = std::nullopt; 55 | }; 56 | 57 | FRAMELESSHELPER_END_NAMESPACE 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/lib/debug/FramelessHelperCore64d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/lib/debug/FramelessHelperCore64d.lib -------------------------------------------------------------------------------- /3rdparty/framelesshelper/lib/debug/FramelessHelperQuick64d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/lib/debug/FramelessHelperQuick64d.lib -------------------------------------------------------------------------------- /3rdparty/framelesshelper/lib/debug/FramelessHelperWidgets64d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/lib/debug/FramelessHelperWidgets64d.lib -------------------------------------------------------------------------------- /3rdparty/framelesshelper/lib/release/FramelessHelperCore64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/lib/release/FramelessHelperCore64.lib -------------------------------------------------------------------------------- /3rdparty/framelesshelper/lib/release/FramelessHelperQuick64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/lib/release/FramelessHelperQuick64.lib -------------------------------------------------------------------------------- /3rdparty/framelesshelper/lib/release/FramelessHelperWidgets64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/lib/release/FramelessHelperWidgets64.lib -------------------------------------------------------------------------------- /3rdparty/framelesshelper/qml/org/wangwenx190/FramelessHelper/FramelessHelperQuickplugin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/qml/org/wangwenx190/FramelessHelper/FramelessHelperQuickplugin.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/qml/org/wangwenx190/FramelessHelper/FramelessHelperQuickplugind.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/3rdparty/framelesshelper/qml/org/wangwenx190/FramelessHelper/FramelessHelperQuickplugind.dll -------------------------------------------------------------------------------- /3rdparty/framelesshelper/qml/org/wangwenx190/FramelessHelper/qmldir: -------------------------------------------------------------------------------- 1 | module org.wangwenx190.FramelessHelper 2 | linktarget FramelessHelperQuickplugin 3 | optional plugin FramelessHelperQuickplugin 4 | classname org_wangwenx190_FramelessHelperPlugin 5 | typeinfo plugins.qmltypes 6 | import QtQml 7 | import QtQuick 8 | import QtQuick.Controls.Basic 9 | prefer :/org/wangwenx190/FramelessHelper/ 10 | 11 | -------------------------------------------------------------------------------- /3rdparty/framelesshelper/share/FramelessHelper.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildThisFileDirectory)..\lib;$(MSBuildThisFileDirectory)..\lib\debug;$(MSBuildThisFileDirectory)..\lib\release;$(LibraryPath) 5 | 6 | 7 | $(MSBuildThisFileDirectory)..\include;$(MSBuildThisFileDirectory)..\include\FramelessHelper;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Core;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Core\private;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Widgets;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Widgets\private;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Quick;$(MSBuildThisFileDirectory)..\include\FramelessHelper\Quick\private;$(QtHeaderSearchPath) 8 | 9 | 10 | 11 | %(PreprocessorDefinitions) 12 | 13 | 14 | FramelessHelperCore64d.lib;FramelessHelperWidgets64d.lib;FramelessHelperQuick64d.lib;%(AdditionalDependencies); 15 | FramelessHelperCore64.lib;FramelessHelperWidgets64.lib;FramelessHelperQuick64.lib;%(AdditionalDependencies); 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # 贡献指南 2 | 3 | **wechat-client** 是以一个开源项目,使用开发工具vs2019+qt5.12,编写一个仿照微信的界面及功能的项目,采用C++源代码方式编写,无涉及到ui文件。欢迎大家一起交流和贡献代码。 4 | 5 | ## 开始 6 | 7 | ### Fork和clone 8 | 9 | ``` 10 | git clone git@github.com:your-username//wechat-client.git 11 | ``` 12 | 13 | ### 修改和提交 14 | 15 | 创建一个分支,添加一些features(新功能)或者修改bugfixes,创建一个pull requests 16 | 17 | ## 拉取 18 | 19 | 1.open a new issue 20 | 21 | 2.test and check 22 | 23 | 3.waiting for merge -------------------------------------------------------------------------------- /Client/App.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "LoginRegWnd.h" 5 | #include "NetClientUtils.h" 6 | #include "DealNewFriendsApplyWnd.h" 7 | #include 8 | #include "StyleSheetMgr.h" 9 | #include "DataManager.h" 10 | #include "Log.h" 11 | #include 12 | 13 | int main(int argc, char** argv) 14 | { 15 | LogFunc; 16 | QApplication app(argc, argv); 17 | app.setWindowIcon(QIcon("./img/wechat.ico")); 18 | 19 | LogD << "App Start:"; 20 | LogD << SplitStr; 21 | Log::init(); 22 | StyleSheetMgr::initMgr(); 23 | NetClientUtils::init(); 24 | DataManager::initMgr(); 25 | 26 | // 加载本地的样式表 27 | QFile qss("./stylesheet/wechat.qss"); 28 | if (qss.open(QFile::ReadOnly)) 29 | { 30 | app.setStyleSheet(qss.readAll()); 31 | qss.close(); 32 | } 33 | 34 | // 登录窗口 35 | LoginRegWnd lgw; 36 | lgw.show(); 37 | 38 | app.exec(); 39 | 40 | // 最后退出日志 41 | DataManager::exitMgr(); 42 | NetClientUtils::deinit(); 43 | StyleSheetMgr::exitMgr(); 44 | Log::deinit(); 45 | } -------------------------------------------------------------------------------- /Client/ApplyFriendInputInfoWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "ApplyFriendInputInfoWnd.h" 2 | #include "SelfLabel.h" 3 | #include "StyleSheetMgr.h" 4 | 5 | ApplyFriendInputInfoWnd::ApplyFriendInputInfoWnd(QWidget* p /*= nullptr*/) : QWidget(p) 6 | { 7 | LogFunc; 8 | setObjectName("QApplyFriendInputInfoWnd"); 9 | QStyleSheetObject object; 10 | object.m_qssFileName = "./stylesheet/" + objectName() + ".qss"; 11 | object.m_widget = this; 12 | StyleSheetMgr::getMgr()->reg(object.m_qssFileName, object); 13 | 14 | setContentsMargins(0, 0, 0, 0); 15 | setFixedSize(460, 280); 16 | 17 | // 窗口主要布局为水平布局 18 | m_hLayout = new QHBoxLayout(); 19 | setLayout(m_hLayout); 20 | 21 | m_userInfoWnd = new QWidget(); 22 | m_vUserInfoLayout = new QVBoxLayout(); 23 | 24 | m_headUrl = new QLabel(); 25 | m_userName = new QLabel(); 26 | m_moreInfo = new QLabel(); 27 | 28 | // 设置头像 29 | m_headUrl->setFixedSize(80, 80); 30 | QPixmap headImg = QPixmap("./img/head2.png"); 31 | headImg = headImg.scaled(80, 80, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 32 | m_headUrl->setPixmap(headImg); 33 | 34 | // 用户名 35 | m_userName->setText("玩家的编号 "); 36 | m_moreInfo->setText("更多的信息... "); 37 | 38 | m_vUserInfoLayout->addWidget(m_headUrl); 39 | m_vUserInfoLayout->addSpacing(20); 40 | m_vUserInfoLayout->addWidget(m_userName); 41 | m_vUserInfoLayout->addSpacing(20); 42 | m_vUserInfoLayout->addWidget(m_moreInfo); 43 | m_vUserInfoLayout->addStretch(); 44 | 45 | m_userInfoWnd->setLayout(m_vUserInfoLayout); 46 | m_userInfoWnd->setFixedWidth(130); 47 | // m_userInfoWnd->setWindowFlags(Qt::FramelessWindowHint); 48 | // m_userInfoWnd->setStyleSheet("background-color:#aaa;border:0px;"); 49 | m_hLayout->addWidget(m_userInfoWnd); 50 | 51 | // 添加一个分割条 52 | m_split = new SelfSplit(nullptr, SelfSplit::Direction_V); 53 | m_hLayout->addWidget(m_split); 54 | 55 | m_vLayout = new QVBoxLayout(); 56 | m_inputMsgLabel = new QLabel(); 57 | m_inputMsgEdit = new QTextEdit(); 58 | 59 | m_inputMsgLabel->setText("请输入验证信息:"); 60 | m_inputMsgEdit->setFixedWidth(280); 61 | m_inputMsgEdit->setFixedHeight(150); 62 | 63 | m_vLayout->addWidget(m_inputMsgLabel); 64 | m_vLayout->addWidget(m_inputMsgEdit); 65 | m_vLayout->addStretch(); 66 | 67 | m_hLayout->addLayout(m_vLayout); 68 | } 69 | -------------------------------------------------------------------------------- /Client/ApplyFriendInputInfoWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "SelfSplit.h" 13 | 14 | // 添加好友时候,最先展示的窗口,填写一些验证消息 15 | class ApplyFriendInputInfoWnd : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | ApplyFriendInputInfoWnd(QWidget* p = nullptr); 20 | 21 | public: 22 | QWidget* m_centerWnd; 23 | // 主要布局 24 | QHBoxLayout* m_hLayout; 25 | QVBoxLayout* m_vLayout; 26 | 27 | // 联系人头像 28 | QLabel* m_headUrl; 29 | 30 | // 角色名 31 | QLabel* m_userName; 32 | // 其他信息 33 | QLabel* m_moreInfo; 34 | // 用户信息窗口 35 | QWidget* m_userInfoWnd; 36 | QVBoxLayout* m_vUserInfoLayout; 37 | 38 | // 左部窗口与右部串口的分割条 39 | SelfSplit* m_split; 40 | 41 | // 输入验证消息的标签 42 | QLabel* m_inputMsgLabel; 43 | // 输入验证消息的文本框 44 | QTextEdit* m_inputMsgEdit; 45 | }; -------------------------------------------------------------------------------- /Client/ApplyFriendNextWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class ApplyFriendNextWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | ApplyFriendNextWnd(QWidget* p = nullptr, int64_t friendid = -1, QString username = ""); 17 | 18 | enum class PushBtnState 19 | { 20 | PBS_Next = 0, 21 | PBS_Close = 1 22 | }; 23 | 24 | public: 25 | void mouseMoveEvent(QMouseEvent* event); 26 | void mousePressEvent(QMouseEvent* event); 27 | void mouseReleaseEvent(QMouseEvent* event); 28 | 29 | public slots: 30 | void closeWnd(); 31 | void minWnd(); 32 | void slotPushBtnClick(); 33 | 34 | public: 35 | QWidget* m_centerWnd; 36 | int m_index = 0; 37 | 38 | QLabel* m_titleLabel; 39 | QPushButton* m_minBtn; 40 | QPushButton* m_closeBtn; 41 | 42 | QWidget* m_wnd1; 43 | QWidget* m_wnd2; 44 | 45 | QPushButton* m_pushBtn; 46 | QStackedLayout* m_sLayout; 47 | QVBoxLayout* m_vLayout; 48 | 49 | QHBoxLayout* m_hLayout1; 50 | QHBoxLayout* m_hLayout2; 51 | 52 | bool m_bPress = false; 53 | QPoint m_poPress; 54 | 55 | PushBtnState m_state; 56 | 57 | int64_t m_friendid; 58 | QString m_username; 59 | }; 60 | -------------------------------------------------------------------------------- /Client/ApplyFriendWaitInfoWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "ApplyFriendWaitInfoWnd.h" 2 | 3 | ApplyFriendWaitInfoWnd::ApplyFriendWaitInfoWnd(QWidget* p /*= nullptr*/) : QWidget(p) 4 | { 5 | LogFunc; 6 | setContentsMargins(0, 0, 0, 0); 7 | setFixedSize(460, 280); 8 | // setStyleSheet("background-color:red;"); 9 | 10 | m_vLayout = new QVBoxLayout(); 11 | setLayout(m_vLayout); 12 | m_infoLabel = new QLabel(); 13 | m_infoLabel->setText("你的好友添加请求已经发送成功,正在等待对方确认"); 14 | m_vLayout->addWidget(m_infoLabel); 15 | m_vLayout->addStretch(); 16 | } 17 | -------------------------------------------------------------------------------- /Client/ApplyFriendWaitInfoWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | class ApplyFriendWaitInfoWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | ApplyFriendWaitInfoWnd(QWidget* p = nullptr); 17 | 18 | public: 19 | // 窗口主要布局 20 | QVBoxLayout* m_vLayout; 21 | 22 | // 文本显示 23 | QLabel* m_infoLabel; 24 | }; -------------------------------------------------------------------------------- /Client/ChatFileInnerWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class ChatFileInnerWnd : public QWidget 14 | { 15 | Q_OBJECT 16 | public: 17 | ChatFileInnerWnd(QWidget* p = nullptr); 18 | public slots: 19 | void slotOpenFileBtnClick(); 20 | void slotCopyFileBtnClick(); 21 | void slotOpenFileDirBtnClick(); 22 | void slotDownloadFileBtnClick(); 23 | 24 | public: 25 | void sendFileShow(); 26 | void recvFileShow(); 27 | 28 | public: 29 | QVBoxLayout* m_vLayout; 30 | 31 | QHBoxLayout* m_hLayout1; 32 | QVBoxLayout* m_vLayout1; 33 | QHBoxLayout* m_hLayout2; 34 | 35 | // 进度条,用于显示文件传进度 36 | QProgressBar* m_progressBar; 37 | 38 | QLabel* m_fileIcon; // 文件图标 39 | QLabel* m_fileName; // 文件名 40 | QLabel* m_fileSize; // 文件大小 41 | 42 | QLabel* m_sendState; // 发送状态 43 | QPushButton* m_openFile; // 打开文件 44 | QPushButton* m_copyFile; // 拷贝 45 | QPushButton* m_openFileDir; // 打开所在目录 46 | QPushButton* m_downLoad; // 下载文件 47 | 48 | QString m_fileFullpath = ""; // 文件全路径 49 | QString m_fileFullDir = ""; // 文件所在目录 50 | QString m_serveFilePath = ""; // 远程的文件地址 51 | 52 | // 下载远程文件 53 | QNetworkAccessManager* m_pNetManager; 54 | }; -------------------------------------------------------------------------------- /Client/ChatFileOuterWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "ChatFileInnerWnd.h" 8 | 9 | class ChatFileOuterWnd : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | // 文件类型 14 | enum class ChatFileTypeEnum 15 | { 16 | ChatFile_Owner = 0, // 接收到自己的文件 17 | ChatFile_Other, // 接收到他人的文件 18 | }; 19 | 20 | ChatFileOuterWnd(QWidget* p = nullptr, int64_t sendid = -1, int64_t recvid = -1); 21 | 22 | void setFileName(QString fileName); 23 | 24 | void setFileSize(QString fileSize); 25 | 26 | void setFileDir(QString fileDir); 27 | 28 | void setFilePath(QString filePath); 29 | 30 | void setFileState(QString fileState); 31 | 32 | void setSendFileShow(); 33 | void setRecvFileShow(); 34 | 35 | void setServerFileName(QString serverFileName); 36 | 37 | void setFileUploadData(QString fileName, QString fileSize, QString fileDir, QString filePath); 38 | void setFileDownLoadData(QString fileName, QString fileSize, QString fileState, QString serverFileName); 39 | 40 | void setProgressBarMax(int max); 41 | 42 | void setProgressBarMin(int min); 43 | 44 | void setProgressBarValue(int value); 45 | 46 | public: 47 | QLabel* m_headUrl; // 头像信息 48 | ChatFileInnerWnd* m_innerWnd; // 文件框 49 | QHBoxLayout* m_hLayout; 50 | QVBoxLayout* m_vLayout; 51 | }; -------------------------------------------------------------------------------- /Client/ChatMsgWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | class ChatMsgWnd : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | // 消息类型 14 | enum ChatMsgTypeEnum 15 | { 16 | ChatMsg_System = 10, 17 | ChatMsg_Time, // 时间消息 - (一般由自己产生吧) 18 | ChatMsg_OwnerMsgText, // 自己的消息 19 | ChatMsg_OtherMsgText, // 其他人发送的消息 20 | }; 21 | 22 | public: 23 | // 构造函数 24 | ChatMsgWnd(QWidget* p = nullptr, int64_t sendid = 0, QString userName = "", int64_t recvid = 0); 25 | 26 | // 根据str调整各个框的大小 27 | QSize fontRect(QString str); 28 | 29 | QSize getRealStringSize(QString str); 30 | 31 | void setText(QString text, QString time, QSize allSize, ChatMsgWnd::ChatMsgTypeEnum chatMsgType); 32 | 33 | protected: 34 | // 绘制 35 | void paintEvent(QPaintEvent* event); 36 | 37 | public: 38 | int64_t m_sendid; 39 | int64_t m_recvid; 40 | 41 | QString m_msg; 42 | QString m_time; 43 | QString m_curTime; 44 | QSize m_allSize; 45 | QString m_userName; 46 | 47 | ChatMsgTypeEnum m_chatMsgType = ChatMsg_System; 48 | 49 | int m_outerFrameWidth; 50 | int m_textWidth; 51 | // int m_spaceWidth; 52 | int m_lineHeight; 53 | 54 | QRect m_iconLeftRect; 55 | QRect m_iconRightRect; 56 | 57 | QRect m_triangleLeftRect; 58 | QRect m_triangleRightRect; 59 | 60 | QRect m_outerFrameLeftRect; 61 | QRect m_outerFrameRightRect; 62 | 63 | QRect m_leftUserNameRect; 64 | QRect m_rightUserNameRect; 65 | 66 | // 文字文本框 67 | QRect m_textLeftRect; 68 | QRect m_textRigtRect; 69 | 70 | QPixmap m_leftPixmap; 71 | QPixmap m_rightPixmap; 72 | 73 | QLabel* m_loadingLable = nullptr; 74 | QMovie* m_loadingMovie = nullptr; 75 | 76 | // 是否在发送中 77 | bool m_bSending = false; 78 | 79 | static int m_tmp; 80 | 81 | bool m_bShowName = true; 82 | }; -------------------------------------------------------------------------------- /Client/Client.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/Client.aps -------------------------------------------------------------------------------- /Client/Client.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON "img\\wechat.ico" 2 | -------------------------------------------------------------------------------- /Client/Client.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | PATH=$(QtDllPath);%PATH%;$(SolutionDir)3rdparty\framelesshelper\bin\debug 5 | WindowsLocalDebugger 6 | 7 | 8 | 2024-05-12T07:23:29.6701120Z 9 | 10 | 11 | 12 | 13 | 2024-05-12T07:23:30.2266830Z 14 | 15 | 16 | 17 | 18 | 2024-05-12T07:23:29.2289862Z 19 | 20 | 21 | 22 | 23 | 2024-05-12T07:23:29.5249929Z 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Client/CommContactInfoWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class CommContactInfoWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | CommContactInfoWnd(QWidget* p = nullptr); 17 | ~CommContactInfoWnd(); 18 | signals: 19 | void signalSendMsgBtnClick(QMap map); 20 | public slots: 21 | void slotContactInfoChange(QMap map); 22 | void slotSendMsgBtnClick(); 23 | 24 | public: 25 | void showBgPng(); 26 | void hideBgPng(); 27 | 28 | public: 29 | QVBoxLayout* m_vLayout; 30 | 31 | QWidget* m_contentWnd; 32 | QVBoxLayout* m_vLayout1; 33 | 34 | QHBoxLayout* m_hLayout0; // 顶部的最大化,最小化按钮等 35 | QHBoxLayout* m_hLayout1; 36 | QHBoxLayout* m_hLayout2; 37 | QHBoxLayout* m_hLayout3; 38 | QHBoxLayout* m_hLayout4; 39 | QHBoxLayout* m_hLayout5; 40 | 41 | QPushButton* m_minBtn; 42 | QPushButton* m_maxBtn; 43 | QPushButton* m_closeBtn; 44 | 45 | QLabel* m_nickNameLabel; 46 | QLabel* m_headimgLabel; 47 | 48 | QLabel* m_markNameLabel; 49 | QLabel* m_rolenameLabel; // 角色名 50 | QLabel* m_channelLabel; 51 | 52 | QLabel* m_markNameFillLabel; 53 | QLabel* m_rolenameFillLabel; 54 | QLabel* m_channelFillLabel; 55 | 56 | // 发送消息窗口 57 | QPushButton* m_sendMsgBtn; 58 | }; 59 | -------------------------------------------------------------------------------- /Client/CommContactItemWnd.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "DataManager.h" 5 | #include "CommContactItemWnd.h" 6 | 7 | CommContactItemWnd::CommContactItemWnd(QWidget* p) : QWidget(p) 8 | { 9 | LogFunc; 10 | setObjectName("QCommContactItemWnd"); 11 | } 12 | 13 | CommContactItemWnd::CommContactItemWnd(QWidget* p, const char* headUrl, const char* name, bool bNewFriend /* = false*/, int friendid /* = -1*/) : QWidget(p), m_bNewFriend(bNewFriend), m_friendId(friendid) 14 | { 15 | LogFunc; 16 | setObjectName("QCommContactItemWnd"); 17 | m_hLayout = new QHBoxLayout(this); 18 | m_hLayout->setSpacing(0); 19 | setLayout(m_hLayout); 20 | m_headUrl = new QLabel(); 21 | 22 | m_headUrl->setPixmap(QPixmap(headUrl)); 23 | m_headUrl->setFixedSize(40, 40); 24 | m_name = new QLabel(); 25 | 26 | m_name->setText(name); 27 | m_hLayout->addWidget(m_headUrl); 28 | m_hLayout->addSpacing(15); 29 | m_hLayout->addWidget(m_name); 30 | 31 | // 向远端请求头像的信息 32 | QString imgurl = QString("http://49.232.169.205:80/UploadDemo/img/u%1.png").arg(friendid); 33 | m_networkMgr = new QNetworkAccessManager(); 34 | connect(m_networkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(slotReplyFinished(QNetworkReply*))); 35 | m_networkMgr->get(QNetworkRequest(QUrl(imgurl))); 36 | 37 | if (name != NULL && !bNewFriend) 38 | { 39 | DataManager::getMgr()->m_FriendId2NameMap[friendid] = name; 40 | } 41 | 42 | setFixedHeight(65); 43 | 44 | LogD << "w:" << this->width() << "h:" << this->height(); 45 | } 46 | 47 | CommContactItemWnd::~CommContactItemWnd() 48 | { 49 | if (m_networkMgr) 50 | { 51 | delete m_networkMgr; 52 | m_networkMgr = nullptr; 53 | } 54 | } 55 | 56 | void CommContactItemWnd::slotReplyFinished(QNetworkReply* reply) 57 | { 58 | if (reply->error() == QNetworkReply::NoError) 59 | { 60 | QPixmap pixmap; 61 | pixmap.loadFromData(reply->readAll()); 62 | pixmap = pixmap.scaled(40, 40); 63 | m_headUrl->setPixmap(pixmap); 64 | DataManager::getMgr()->m_UserId2HeadImgMap[m_friendId] = pixmap; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Client/CommContactItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class CommContactItemWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | CommContactItemWnd(QWidget* p); 16 | 17 | CommContactItemWnd(QWidget* p, const char* headUrl, const char* name, bool bNewFriend = false, int friendid = -1); 18 | 19 | ~CommContactItemWnd(); 20 | public slots: 21 | void slotReplyFinished(QNetworkReply* reply); 22 | QString getContactItemName() 23 | { 24 | return m_name->text(); 25 | } 26 | 27 | void setContactItemName(const QString& name) 28 | { 29 | m_name->setText(name); 30 | } 31 | 32 | int64_t getFriendId() 33 | { 34 | return m_friendId; 35 | } 36 | 37 | void setFriendId(int64_t friendId) 38 | { 39 | m_friendId = friendId; 40 | } 41 | 42 | public: 43 | QHBoxLayout* m_hLayout; 44 | // 联系人头像 45 | QLabel* m_headUrl; 46 | // 联系人名字 47 | QLabel* m_name; 48 | // 是否是新的朋友那一栏消息 49 | bool m_bNewFriend = false; 50 | // 标识联系人的id 51 | int64_t m_friendId = -1; 52 | QNetworkAccessManager* m_networkMgr; 53 | }; -------------------------------------------------------------------------------- /Client/CommGroupItemWnd.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "DataManager.h" 5 | #include "CommGroupItemWnd.h" 6 | 7 | CommGroupItemWnd::CommGroupItemWnd(QWidget* p) : QWidget(p) 8 | { 9 | LogFunc; 10 | setObjectName("QCommGroupItemWnd"); 11 | } 12 | 13 | CommGroupItemWnd::CommGroupItemWnd(QWidget* p, const char* headUrl, const char* name, int groupId) : QWidget(p), m_groupId(groupId) 14 | { 15 | LogFunc; 16 | setObjectName("QCommGroupItemWnd"); 17 | m_hLayout = new QHBoxLayout(this); 18 | m_hLayout->setSpacing(0); 19 | setLayout(m_hLayout); 20 | m_groupImgUrl = new QLabel(); 21 | 22 | m_groupImgUrl->setPixmap(QPixmap(headUrl)); 23 | m_groupImgUrl->setFixedSize(40, 40); 24 | m_groupName = new QLabel(); 25 | 26 | m_groupName->setText(name); 27 | m_hLayout->addWidget(m_groupImgUrl); 28 | m_hLayout->addSpacing(15); 29 | m_hLayout->addWidget(m_groupName); 30 | 31 | // 关于请求图片信息 32 | QString imgurl = QString("http://49.232.169.205:80/UploadDemo/img/g%1.png").arg(groupId); 33 | m_networkMgr = new QNetworkAccessManager(this); 34 | connect(m_networkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(slotReplyFinished(QNetworkReply*))); 35 | m_networkMgr->get(QNetworkRequest(QUrl(imgurl))); 36 | 37 | setFixedHeight(65); 38 | } 39 | 40 | CommGroupItemWnd::~CommGroupItemWnd() 41 | { 42 | if (m_networkMgr) 43 | { 44 | m_networkMgr = nullptr; 45 | delete m_networkMgr; 46 | } 47 | } 48 | 49 | void CommGroupItemWnd::slotReplyFinished(QNetworkReply* reply) 50 | { 51 | if (reply->error() == QNetworkReply::NoError) 52 | { 53 | QPixmap pixmap; 54 | pixmap.loadFromData(reply->readAll()); 55 | pixmap = pixmap.scaled(40, 40); 56 | m_groupImgUrl->setPixmap(pixmap); 57 | DataManager::getMgr()->m_GroupId2ImgMap[m_groupId] = pixmap; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Client/CommGroupItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class CommGroupItemWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | CommGroupItemWnd(QWidget* p); 16 | 17 | CommGroupItemWnd(QWidget* p, const char* headUrl, const char* name, int groupId = -1); 18 | 19 | ~CommGroupItemWnd(); 20 | public slots: 21 | void slotReplyFinished(QNetworkReply* reply); 22 | 23 | public: 24 | QHBoxLayout* m_hLayout; 25 | // 联系人头像 26 | QLabel* m_groupImgUrl; 27 | // 联系人名字 28 | QLabel* m_groupName; 29 | // 标识联系人的id 30 | int m_groupId = -1; 31 | // 用于请求头像信息 32 | QNetworkAccessManager* m_networkMgr; 33 | }; -------------------------------------------------------------------------------- /Client/CommListWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include "SelectGroupFriendWnd.h" 15 | 16 | class CommListWnd : public QWidget 17 | { 18 | // 添加消息映射支持 19 | Q_OBJECT 20 | 21 | public: 22 | enum QCommListWndEnum 23 | { 24 | MsgItemWndTpye = 0, 25 | ContactItemWndType = 1, 26 | GroupItemWndType = 2, 27 | SearchItemWndType = 3 28 | }; 29 | 30 | CommListWnd(QWidget* p = nullptr, QCommListWndEnum wndType = MsgItemWndTpye); 31 | 32 | signals: 33 | void signalCommListChanged(int num); 34 | void signalContactInfoChange(QMap infoMap); 35 | void signalSearchText(QString searchText); 36 | public slots: 37 | void slotOnCurrentItemClicked(QListWidgetItem* item); 38 | // 如果点击那个按钮的话 39 | void slotOnStartGroupBtnClicked(); 40 | 41 | protected: 42 | bool eventFilter(QObject* target, QEvent* event); 43 | 44 | public: 45 | void addMsgItem(const char* name, const char* msg, qint64 sesid, int64_t userid, bool isGroupMsg); 46 | void addContactsItem(const char* headUrl, const char* name, bool isNewFriend = false, int friendid = -1); 47 | void addGroupItem(const char* headUrl, const char* name, int groupid); 48 | 49 | bool hasMsgItemBySesId(int64_t sesid); 50 | bool hasGroupItemByGroupId(int64_t groupid); 51 | bool hasContactsItemByFriendId(int64_t friendId); 52 | 53 | void setGroupItemNameByGroupId(int64_t grouId, QString groupName); 54 | void setMsgItemNameBySesId(int64_t sesId, QString msgItemName); 55 | 56 | QVBoxLayout* m_vLayout; 57 | QHBoxLayout* m_hLayout; 58 | 59 | // 搜索框 60 | QLineEdit* m_searchEdit; 61 | 62 | // 开始的那个按钮 63 | QPushButton* m_startGroupBtn; 64 | 65 | SelectGroupFriendWnd* m_selectWnd; 66 | 67 | QListWidget* m_listWidget; 68 | 69 | // 窗口类型 70 | QCommListWndEnum m_WndType; 71 | }; -------------------------------------------------------------------------------- /Client/CommMsgItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | /* 13 | * 消息具体内容类:消息,头像,联系人名字等 14 | */ 15 | class CommMsgItemWnd : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | CommMsgItemWnd(QWidget* p); 20 | CommMsgItemWnd(QWidget* p, const char* name, const char* msg, int64_t sesid, int64_t userid, bool isGroppMsg); 21 | ~CommMsgItemWnd(); 22 | 23 | void requestHeadImg(int id, bool isGroupMsg); 24 | void loadUserHeadPixmap(QNetworkReply* reply); 25 | void loadGroupHeadPixmap(QNetworkReply* reply); 26 | public slots: 27 | void slotReplyFinished(QNetworkReply* reply); 28 | 29 | public: 30 | QVBoxLayout* m_vLayout; 31 | QHBoxLayout* m_hLayout; 32 | QLabel* m_headurl; 33 | QLabel* m_usernameLabel; 34 | QLabel* m_msgLabel; 35 | int64_t m_userid; 36 | int64_t m_sesId; 37 | bool m_isGroupMsg; 38 | QString m_url; 39 | QNetworkAccessManager* m_networkMgr; 40 | }; -------------------------------------------------------------------------------- /Client/CreateGroupListItemWithSelBtnWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class CreateGroupListItemWithSelBtnWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | CreateGroupListItemWithSelBtnWnd(QWidget* p = nullptr); 16 | CreateGroupListItemWithSelBtnWnd(QWidget* p, const char* headimg, int64_t friendid, const char* nickname, const char* rolename); 17 | signals: 18 | void signalSelRBtnClick(QMap map); 19 | public slots: 20 | void slotClickedSelBtn(bool isSel = false); 21 | 22 | public: 23 | QHBoxLayout* m_hLayout; 24 | QLabel* m_headImage; 25 | QLabel* m_nickName; 26 | QLabel* m_roleName; 27 | QString m_headImgStr; 28 | int64_t m_friendid; 29 | QRadioButton* m_selRBtn; 30 | }; -------------------------------------------------------------------------------- /Client/CreateGroupListItemWnd.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "DataManager.h" 3 | #include "CreateGroupListItemWnd.h" 4 | 5 | CreateGroupListItemWnd::CreateGroupListItemWnd(QWidget* p /*= nullptr*/) : QWidget(p) 6 | { 7 | LogFunc; 8 | setObjectName("QCreateGroupListItemWnd"); 9 | m_hLayout = new QHBoxLayout(); 10 | setLayout(m_hLayout); 11 | 12 | m_headImage = new QLabel(); 13 | m_nickName = new QLabel(); 14 | m_roleName = new QLabel(); 15 | 16 | m_nickName->setText(" nickname "); 17 | m_roleName->setText(" (0123456) "); 18 | 19 | m_hLayout->addWidget(m_headImage); 20 | m_hLayout->addWidget(m_nickName); 21 | m_hLayout->addWidget(m_roleName); 22 | } 23 | 24 | CreateGroupListItemWnd::CreateGroupListItemWnd(QWidget* p, const char* headimg, int64_t friendid, const char* nickname, const char* rolename) : QWidget(p), m_friendid(friendid) 25 | { 26 | LogFunc; 27 | setObjectName("QCreateGroupListItemWnd"); 28 | m_hLayout = new QHBoxLayout(); 29 | m_hLayout->setAlignment(Qt::AlignHCenter); 30 | setLayout(m_hLayout); 31 | setFixedSize(275, 30); 32 | setWindowFlags(Qt::FramelessWindowHint); 33 | setContentsMargins(0, 0, 0, 0); 34 | 35 | m_headImage = new QLabel(); 36 | m_nickName = new QLabel(); 37 | m_roleName = new QLabel(); 38 | // m_selRBtn = new QRadioButton(); 39 | 40 | m_nickName->setText(nickname); 41 | m_roleName->setText(rolename); 42 | 43 | m_headImgStr = headimg; 44 | QPixmap pixmap1 = QPixmap(headimg); 45 | QPixmap pixmap2 = pixmap1.scaled(25, 25, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 46 | m_headImage->setPixmap(QPixmap(headimg)); 47 | m_headImage->setFixedSize(25, 25); 48 | 49 | QPixmap p1 = DataManager::getMgr()->m_UserId2HeadImgMap[m_friendid]; 50 | p1 = p1.scaled(25, 25); 51 | m_headImage->setPixmap(p1); 52 | 53 | m_hLayout->addWidget(m_headImage); 54 | m_hLayout->addWidget(m_nickName); 55 | m_hLayout->addWidget(m_roleName); 56 | m_hLayout->addStretch(); 57 | } 58 | -------------------------------------------------------------------------------- /Client/CreateGroupListItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class CreateGroupListItemWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | CreateGroupListItemWnd(QWidget* p = nullptr); 16 | CreateGroupListItemWnd(QWidget* p, const char* headimg, int64_t friendid, const char* nickname, const char* rolename); 17 | 18 | public: 19 | QHBoxLayout* m_hLayout; 20 | QLabel* m_headImage; 21 | QLabel* m_nickName; 22 | QLabel* m_roleName; 23 | QString m_headImgStr; 24 | int64_t m_friendid; 25 | }; -------------------------------------------------------------------------------- /Client/CreateGroupWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | class CreateGroupWnd : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | CreateGroupWnd(QWidget* p = nullptr); 20 | 21 | void mouseMoveEvent(QMouseEvent* event); 22 | void mousePressEvent(QMouseEvent* event); 23 | void mouseReleaseEvent(QMouseEvent* event); 24 | 25 | void addListWnd1Item(const char* headUrl, int64_t friendid, const char* nickname, const char* rolename); 26 | void addListWnd2Item(const char* headUrl, int64_t friendid, const char* nickname, const char* rolename); 27 | 28 | // 通过rolename判断listwnd2中是否已经添加此窗口 29 | bool hasThisWndByRolename(QString rolename, QListWidget* listWnd); 30 | // 通过rolename移除listwnd2中中此窗口 31 | void delThisWndByRolename(QString rolename, QListWidget* listWnd); 32 | 33 | // 主要是读取当前有几个好友并显示 34 | void updateData(); 35 | public slots: 36 | void closeWnd(); 37 | void minWnd(); 38 | 39 | // 接收到来自单选的按钮的选择时候 40 | void slotSelRBtnClick(QMap map); 41 | // 点击确认按钮的响应 42 | void slotComfirmBtnClick(); 43 | 44 | public: 45 | QWidget* m_centerWnd; 46 | 47 | QVBoxLayout* m_vLayout; 48 | 49 | QHBoxLayout* m_hLayout1; 50 | 51 | // 提供顶部支持,title,关闭和缩小按钮 52 | QHBoxLayout* m_hLayout2; 53 | QLabel* m_titleLabel; 54 | QPushButton* m_minBtn; 55 | QPushButton* m_closeBtn; 56 | 57 | QLineEdit* m_serchEdit; 58 | QListWidget* m_listWnd1; 59 | QVBoxLayout* m_vLayout1; 60 | 61 | QLabel* m_hasSelLabel; 62 | QListWidget* m_listWnd2; 63 | QLineEdit* m_groupNameEdit; 64 | QHBoxLayout* m_hLayout3; 65 | QPushButton* m_comfirmBtn; 66 | QVBoxLayout* m_vLayout2; 67 | 68 | bool m_bPress = false; 69 | QPoint m_poPress; 70 | }; -------------------------------------------------------------------------------- /Client/CustomListWidgetItem.cpp: -------------------------------------------------------------------------------- 1 | #include "def.h" 2 | #include "CustomListWidgetItem.h" 3 | 4 | CustomListWidgetItem::CustomListWidgetItem(QListWidget* view /*= nullptr*/, int type /*= Type*/) : QListWidgetItem(view, type) 5 | { 6 | LogFunc; 7 | m_sesId = 0; 8 | } 9 | 10 | CustomListWidgetItem::~CustomListWidgetItem() 11 | { 12 | LogFunc; 13 | } 14 | 15 | int CustomListWidgetItem::sesId() const 16 | { 17 | return m_sesId; 18 | } 19 | 20 | void CustomListWidgetItem::setSesId(int sesid) 21 | { 22 | m_sesId = sesid; 23 | } 24 | -------------------------------------------------------------------------------- /Client/CustomListWidgetItem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | 7 | class CustomListWidgetItem : public QListWidgetItem 8 | { 9 | public: 10 | explicit CustomListWidgetItem(QListWidget* view = nullptr, int type = 0); 11 | ~CustomListWidgetItem(); 12 | 13 | int sesId() const; 14 | void setSesId(int sesid); 15 | 16 | private: 17 | // 添加一些额外的数据,如会话id; 18 | // 设置默认值为-1 19 | int m_sesId = -1; 20 | }; -------------------------------------------------------------------------------- /Client/DataManager.cpp: -------------------------------------------------------------------------------- 1 | #include "DataManager.h" 2 | #include "def.h" 3 | 4 | DataManager* DataManager::m_dataManager = nullptr; 5 | 6 | DataManager::DataManager() 7 | { 8 | LogFunc; 9 | QFile emoijFile("./emoij/emoij.txt"); 10 | if (emoijFile.exists() && emoijFile.open(QIODevice::ReadOnly | QIODevice::Text)) 11 | { 12 | QString str = emoijFile.readAll(); 13 | m_emoijStrList = str.split('|', Qt::SkipEmptyParts); 14 | emoijFile.close(); 15 | } 16 | } 17 | 18 | DataManager* DataManager::getMgr() 19 | { 20 | if (m_dataManager == nullptr) 21 | { 22 | m_dataManager = new DataManager(); 23 | } 24 | return m_dataManager; 25 | } 26 | 27 | void DataManager::exitMgr() 28 | { 29 | if (m_dataManager != nullptr) 30 | { 31 | delete m_dataManager; 32 | m_dataManager = nullptr; 33 | } 34 | } 35 | 36 | void DataManager::setUserIdAndName(int64_t userId, QString userName) 37 | { 38 | m_userid = userId; 39 | m_username = userName; 40 | } 41 | 42 | void DataManager::setUserHeadImg(int64_t userId, QPixmap pixmap) 43 | { 44 | m_UserId2HeadImgMap[userId] = pixmap; 45 | } 46 | -------------------------------------------------------------------------------- /Client/DataManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | typedef std::map QUserId2HeadImgMap; 8 | typedef std::map QGroupId2HeadImgMap; 9 | typedef std::map QFriendId2NameMap; 10 | 11 | class DataManager 12 | { 13 | private: 14 | explicit DataManager(); 15 | 16 | public: 17 | static DataManager* getMgr(); 18 | static void initMgr() 19 | { 20 | getMgr(); 21 | } 22 | static void exitMgr(); 23 | void setUserIdAndName(int64_t userId, QString userName); 24 | void setUserHeadImg(int64_t userId, QPixmap pixmap); 25 | 26 | private: 27 | static DataManager* m_dataManager; 28 | 29 | public: 30 | QUserId2HeadImgMap m_UserId2HeadImgMap; 31 | QFriendId2NameMap m_FriendId2NameMap; 32 | QGroupId2HeadImgMap m_GroupId2ImgMap; 33 | // 本地文件保存的目录 34 | QString m_localRecvFileDir = "./recvFile/"; 35 | QStringList m_emoijStrList; 36 | int64_t m_userid = -1; 37 | QString m_username = ""; 38 | }; -------------------------------------------------------------------------------- /Client/DealNewFriendsApplyItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class DealNewFriendsApplyItemWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | DealNewFriendsApplyItemWnd(QWidget* p = nullptr, const char* headurl = "", const char* name = "", const char* msg = "", int state = 0, int id = 0, bool isApplyer = false, int userid = 0); 16 | public slots: 17 | void slotOnAgreeBtnClick(); 18 | void slotOnRefuseBtnClick(); 19 | 20 | public: 21 | QVBoxLayout* m_vLayout; 22 | QHBoxLayout* m_hLayout; 23 | QLabel* m_headurl; 24 | QLabel* m_name; 25 | QLabel* m_msg; 26 | // 同意的那个按钮 27 | QPushButton* m_AgreeBtn; 28 | QPushButton* m_refuseBtn; 29 | // 状态 30 | int m_state; 31 | // 所在的id 32 | int m_id; 33 | // 34 | int m_userid; 35 | // 是否是申请者 36 | bool m_isApplyer; 37 | }; -------------------------------------------------------------------------------- /Client/DealNewFriendsApplyWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | class DealNewFriendsApplyWnd : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | DealNewFriendsApplyWnd(QWidget* p = nullptr); 20 | 21 | protected: 22 | void resizeEvent(QResizeEvent* event) override; 23 | 24 | public: 25 | void addListItem(const char* headurl, const char* name, const char* msg, int state, int id, bool isApplyer, int userid); 26 | 27 | // 设置申请列表信息,向远端服务器请求申请列表并添加 28 | void setFriendApplyList(); 29 | 30 | // 遍历item,判断是否已经向列表中嵌入这个id 31 | bool hasThisFriendApplyById(int id); 32 | public slots: 33 | 34 | public: 35 | QVBoxLayout* m_vLayout; 36 | QHBoxLayout* m_hLayout; 37 | QLabel* m_titileLable; 38 | QPushButton* m_minBtn; 39 | QPushButton* m_maxBtn; 40 | QPushButton* m_closeBtn; 41 | 42 | QTabWidget* m_tabWnd; 43 | QListWidget* m_listWnd1; 44 | QListWidget* m_listWnd2; 45 | 46 | bool m_bPress = false; 47 | QPoint m_poPress; 48 | }; -------------------------------------------------------------------------------- /Client/EditLabel.cpp: -------------------------------------------------------------------------------- 1 | #include "EditLabel.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | EditLabel::EditLabel(QWidget* parent) : QWidget(parent) 11 | { 12 | LogFunc; 13 | setObjectName("QEditLabel"); 14 | 15 | m_StackLayout = new QStackedLayout(this); 16 | setLayout(m_StackLayout); 17 | 18 | m_label = new QLabel(this); 19 | m_label->setObjectName("TmpLabel"); 20 | m_lineEdit = new QLineEdit(this); 21 | m_lineEdit->setObjectName("TmpLineEdit"); 22 | m_label->setFocusPolicy(Qt::FocusPolicy::ClickFocus); 23 | 24 | m_label->installEventFilter(this); 25 | m_lineEdit->installEventFilter(this); 26 | 27 | m_StackLayout->addWidget(m_label); 28 | m_StackLayout->addWidget(m_lineEdit); 29 | m_StackLayout->setCurrentWidget(m_label); 30 | } 31 | 32 | void EditLabel::setText(const char* text) 33 | { 34 | if (m_label) 35 | { 36 | m_label->setText(text); 37 | } 38 | } 39 | 40 | QString EditLabel::getText() 41 | { 42 | if (m_label == nullptr) 43 | return ""; 44 | 45 | return m_label->text(); 46 | } 47 | 48 | bool EditLabel::eventFilter(QObject* obj, QEvent* e) 49 | { 50 | if (obj == m_label) 51 | { 52 | if (e->type() == QEvent::MouseButtonDblClick) 53 | { 54 | m_lineEdit->setText(m_label->text()); 55 | m_StackLayout->setCurrentWidget(m_lineEdit); 56 | m_bShowLable = false; 57 | } 58 | } 59 | 60 | if (obj == m_lineEdit) 61 | { 62 | if (e->type() == QEvent::KeyPress) 63 | { 64 | QKeyEvent* keyEvent = static_cast(e); 65 | LogD << "key:" << keyEvent->key(); 66 | if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) 67 | { 68 | m_label->setText(m_lineEdit->text()); 69 | m_StackLayout->setCurrentWidget(m_label); 70 | emit saveText(); 71 | m_bShowLable = true; 72 | } 73 | } 74 | 75 | if (e->type() == QEvent::FocusOut) 76 | { 77 | m_label->setText(m_lineEdit->text()); 78 | m_StackLayout->setCurrentWidget(m_label); 79 | emit saveText(); 80 | m_bShowLable = true; 81 | } 82 | } 83 | 84 | return QWidget::eventFilter(obj, e); 85 | } -------------------------------------------------------------------------------- /Client/EditLabel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class EditLabel : public QWidget 11 | { 12 | Q_OBJECT 13 | 14 | Q_PROPERTY(bool showLabel READ getShowLabel WRITE setShowLabel) 15 | public: 16 | EditLabel(QWidget* parent = nullptr); 17 | 18 | void setText(const char* text); 19 | QString getText(); 20 | 21 | bool getShowLabel() 22 | { 23 | return m_bShowLable; 24 | } 25 | 26 | void setShowLabel(bool bShowLable) 27 | { 28 | m_bShowLable = bShowLable; 29 | } 30 | signals: 31 | void saveText(); 32 | 33 | protected: 34 | bool eventFilter(QObject* obj, QEvent* e); 35 | 36 | private: 37 | QStackedLayout* m_StackLayout; 38 | QLabel* m_label; 39 | QLineEdit* m_lineEdit; 40 | 41 | bool m_bShowLable; 42 | }; -------------------------------------------------------------------------------- /Client/EmoijWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class EmoijWnd : public QWidget 10 | { 11 | Q_OBJECT 12 | public: 13 | EmoijWnd(QWidget* p = nullptr); 14 | 15 | protected: 16 | bool event(QEvent* event); 17 | 18 | void paintEvent(QPaintEvent* paintEvent); 19 | signals: 20 | void signalEmoijClicked(QString m_emoijString); 21 | public slots: 22 | // 判断哪个单元格子被点击 23 | void slotCellClicked(int x, int y); 24 | 25 | public: 26 | QStringList m_emoijStrList; 27 | QTableWidget* m_centerWnd; 28 | QVBoxLayout* m_vLayout; 29 | }; 30 | -------------------------------------------------------------------------------- /Client/FindFriendItemWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "FindFriendItemWnd.h" 2 | #include "StyleSheetMgr.h" 3 | 4 | FindFriendItemWnd::FindFriendItemWnd(const QString& headUrl, const QString& username, qint64 userid, QWidget* parent /* = nullptr*/) 5 | : QWidget(parent), m_username(username), m_userid(userid) 6 | { 7 | LogFunc; 8 | setObjectName("FindFriendItemWnd"); 9 | QStyleSheetObject object; 10 | object.m_qssFileName = "./stylesheet/" + objectName() + ".qss"; 11 | object.m_widget = this; 12 | StyleSheetMgr::getMgr()->reg(object.m_qssFileName, object); 13 | 14 | m_hLayout = new QHBoxLayout; 15 | m_hLayout->setContentsMargins(0, 0, 0, 0); 16 | m_hLayout->setSpacing(0); 17 | setLayout(m_hLayout); 18 | 19 | m_headImgLabel = new QLabel; 20 | m_headImgLabel->setPixmap(QPixmap(headUrl)); 21 | m_headImgLabel->setFixedSize(40, 40); 22 | 23 | m_usernameLabel = new QLabel; 24 | m_usernameLabel->setText(username); 25 | 26 | //m_hLayout->addSpacing(50); 27 | m_hLayout->addWidget(m_headImgLabel); 28 | m_hLayout->addWidget(m_usernameLabel); 29 | 30 | m_hLayout->addStretch(); 31 | m_addFriendBtn = new QPushButton; 32 | m_addFriendBtn->setText("添加"); 33 | m_addFriendBtn->setFixedSize(60, 30); 34 | 35 | m_hLayout->addWidget(m_addFriendBtn); 36 | 37 | setFixedHeight(60); 38 | connect(m_addFriendBtn, SIGNAL(clicked()), this, SLOT(onAddFriendBtnClick())); 39 | } 40 | 41 | void FindFriendItemWnd::onAddFriendBtnClick() 42 | { 43 | m_nextWnd = new ApplyFriendNextWnd(nullptr, m_userid, m_username); 44 | m_nextWnd->show(); 45 | } 46 | -------------------------------------------------------------------------------- /Client/FindFriendItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "ApplyFriendNextWnd.h" 11 | 12 | class FindFriendItemWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | FindFriendItemWnd(const QString& headUrl, const QString& username, qint64 userid, QWidget* parent = nullptr); 17 | public slots: 18 | void onAddFriendBtnClick(); 19 | 20 | protected: 21 | QHBoxLayout* m_hLayout; 22 | QLabel* m_headImgLabel; 23 | QLabel* m_usernameLabel; 24 | QPushButton* m_addFriendBtn; 25 | 26 | qint64 m_userid; 27 | QString m_username; 28 | ApplyFriendNextWnd* m_nextWnd; 29 | }; -------------------------------------------------------------------------------- /Client/FindFriendOrGroupWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "TopWnd.h" 16 | 17 | class FindFriendOrGroupWnd : public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | FindFriendOrGroupWnd(QWidget* p = nullptr); 22 | 23 | void addFriendItem(const char* headUrl, const char* name, int64 userid); 24 | public slots: 25 | void onSearchBtnClicked(); 26 | 27 | public: 28 | QWidget* m_centerWnd; 29 | QVBoxLayout* m_vLayout; 30 | QHBoxLayout* m_hLayout; 31 | 32 | // top wnd; 33 | TopWnd* m_topWnd; 34 | 35 | QLineEdit* m_searchEdit; 36 | QCheckBox* m_findPersonCheckBox; 37 | QCheckBox* m_findGroupCheckBox; 38 | QPushButton* m_searchBtn; 39 | 40 | // list; 41 | QListWidget* m_listWidget; 42 | }; -------------------------------------------------------------------------------- /Client/GroupFriendsItemWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "GroupFriendsItemWnd.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include "DataManager.h" 7 | 8 | GroupFriendsItemWnd::GroupFriendsItemWnd(QWidget* p /*= nullptr*/) : QWidget(p) 9 | { 10 | setObjectName("QGroupFriendsItemWnd"); 11 | m_hLayout = new QHBoxLayout; 12 | setLayout(m_hLayout); 13 | m_hLayout->setContentsMargins(5, 5, 5, 5); 14 | // setContentsMargins(5, 5, 5, 5); 15 | 16 | m_headImg = new QLabel; 17 | m_headImg->setFixedSize(30, 30); 18 | m_hLayout->addWidget(m_headImg, Qt::AlignHCenter); 19 | 20 | m_name = new QLabel; 21 | m_name->setText("群友昵称"); 22 | m_hLayout->addWidget(m_name); 23 | m_friendId = -1; 24 | 25 | setFixedHeight(40); 26 | setWindowFlags(Qt::FramelessWindowHint); 27 | setAttribute(Qt::WA_StyledBackground); 28 | 29 | m_networkMgr = new QNetworkAccessManager(); 30 | } 31 | 32 | void GroupFriendsItemWnd::requestHeadImg() 33 | { 34 | // 向远端请求头像的信息 35 | QString imgurl = QString("http://49.232.169.205:80/UploadDemo/img/u%1.png").arg(m_friendId); 36 | connect(m_networkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(slotReplyFinished(QNetworkReply*))); 37 | m_networkMgr->get(QNetworkRequest(QUrl(imgurl))); 38 | } 39 | 40 | void GroupFriendsItemWnd::slotReplyFinished(QNetworkReply* reply) 41 | { 42 | if (reply->error() != QNetworkReply::NoError) 43 | return; 44 | 45 | QPixmap pixmap; 46 | pixmap.loadFromData(reply->readAll()); 47 | pixmap = pixmap.scaled(30, 30); 48 | m_headImg->setPixmap(pixmap); 49 | DataManager::getMgr()->m_UserId2HeadImgMap[m_friendId] = pixmap; 50 | reply->deleteLater(); 51 | } 52 | -------------------------------------------------------------------------------- /Client/GroupFriendsItemWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class GroupFriendsItemWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | GroupFriendsItemWnd(QWidget* p = nullptr); 16 | // 向远端请求图片信息 17 | void requestHeadImg(); 18 | public slots: 19 | void slotReplyFinished(QNetworkReply* reply); 20 | 21 | public: 22 | QHBoxLayout* m_hLayout; // 23 | QLabel* m_headImg; // 头像 24 | QLabel* m_name; // 名称 25 | int64_t m_friendId; // 好友id 26 | QNetworkAccessManager* m_networkMgr; 27 | }; -------------------------------------------------------------------------------- /Client/GroupFriendsWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "GroupFriendsWnd.h" 2 | #include 3 | 4 | GroupFriendsWnd::GroupFriendsWnd(QWidget* p /*= nullptr*/) : QWidget(p) 5 | { 6 | LogFunc; 7 | setObjectName("QGroupFriendsWnd"); 8 | 9 | m_vLayout = new QVBoxLayout(); 10 | setLayout(m_vLayout); 11 | 12 | m_listWnd = new QListWidget(); 13 | m_listWnd->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 14 | m_vLayout->addWidget(m_listWnd); 15 | 16 | setContentsMargins(0, 0, 0, 0); 17 | m_vLayout->setContentsMargins(0, 0, 0, 0); 18 | m_listWnd->setContentsMargins(0, 0, 0, 0); 19 | 20 | m_listWnd->setAttribute(Qt::WA_StyledBackground); 21 | m_listWnd->setWindowFlags(Qt::FramelessWindowHint); 22 | 23 | // setAttribute(Qt::WA_StyledBackground); 24 | setWindowFlags(Qt::FramelessWindowHint); 25 | m_listWnd->setStyleSheet("border:0px;"); 26 | } 27 | 28 | void GroupFriendsWnd::addItem(GroupFriendsItemWnd* itemWnd) 29 | { 30 | QListWidgetItem* pListItem = new QListWidgetItem(m_listWnd); 31 | pListItem->setSizeHint(QSize(250, 50)); 32 | // itemWnd->setFixedSize(250, 40); 33 | LogD << "list item size:" << pListItem->sizeHint() << ", item wnd:" << itemWnd->size(); 34 | m_listWnd->setItemWidget(pListItem, itemWnd); 35 | } 36 | -------------------------------------------------------------------------------- /Client/GroupFriendsWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "GroupFriendsItemWnd.h" 11 | 12 | class GroupFriendsWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | GroupFriendsWnd(QWidget* p = nullptr); 17 | void addItem(GroupFriendsItemWnd* w); 18 | 19 | public: 20 | QVBoxLayout* m_vLayout; 21 | QListWidget* m_listWnd; 22 | }; -------------------------------------------------------------------------------- /Client/GroupInfoWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include "EditLabel.h" 14 | #include "SelfSwitchButton.h" 15 | #include "GroupFriendsWnd.h" 16 | 17 | class GroupInfoWnd : public QWidget 18 | { 19 | Q_OBJECT 20 | public: 21 | GroupInfoWnd(QWidget* p = nullptr); 22 | 23 | protected: 24 | bool event(QEvent* event); 25 | 26 | public: 27 | void addGroupFriendItem(int64_t ownerId, QString nickName); 28 | 29 | void setGroupId(int64_t groupId) 30 | { 31 | m_groupId = groupId; 32 | } 33 | 34 | int64_t getGroupId() 35 | { 36 | return m_groupId; 37 | } 38 | 39 | void setGroupName(QString groupName) 40 | { 41 | m_groupName2->setText(groupName.toStdString().c_str()); 42 | } 43 | signals: 44 | void signalUpdateGroupName(QString groupName); 45 | public slots: 46 | void slotSetGroupName(); 47 | 48 | public: 49 | QWidget* m_centerWnd; 50 | // 滚动条 51 | QScrollArea* m_scrollArea; 52 | 53 | // 中间窗口 54 | QWidget* m_scrollAreaWnd; 55 | // 暂时用于测试 56 | // QLabel* m_label; 57 | QVBoxLayout* m_vLayout; 58 | 59 | // 60 | GroupFriendsWnd* m_groupfriendsWnd; 61 | // 此窗口中信息待定,暂时不予处理 62 | 63 | // 简单的群信息窗口 64 | QWidget* m_simpleGroupInfoWnd; 65 | QVBoxLayout* m_vLayout1; 66 | // 群名 67 | QLabel* m_groupName1; 68 | EditLabel* m_groupName2; 69 | 70 | // 群公告 71 | QLabel* m_groupNotice1; 72 | EditLabel* m_groupNotice2; 73 | // 备注 74 | QLabel* m_groupRemarks1; 75 | EditLabel* m_groupRemarks2; 76 | // 我在本群的昵称 77 | QLabel* m_groupRoleName1; 78 | EditLabel* m_groupRoleName2; 79 | 80 | // 简单群的设置窗口 81 | QWidget* m_simpleGroupSettingWnd; 82 | QVBoxLayout* m_vLayout2; 83 | 84 | QHBoxLayout* m_hLayout21; 85 | QLabel* m_showGroupFriendsRoleNameLabel; 86 | SelfSwitchButton* m_showGroupFriendsRoleNameBtn; 87 | 88 | // 消息免打扰 89 | QHBoxLayout* m_hLayout22; 90 | QLabel* m_MsgFreeLabel; 91 | SelfSwitchButton* m_MsgFreeBtn; 92 | 93 | // 置顶聊天 94 | QHBoxLayout* m_hLayout23; 95 | QLabel* m_topWndLabel; 96 | SelfSwitchButton* m_topWndBtn; 97 | 98 | // 保存到通讯录 99 | QHBoxLayout* m_hLayout24; 100 | QLabel* m_save2AddrBookLabel; 101 | SelfSwitchButton* m_save2AddrBookBtn; 102 | 103 | // 删除并退出窗口 104 | QWidget* m_delexitWnd; 105 | QVBoxLayout* m_vLayout3; 106 | QPushButton* m_delexitBtn; 107 | 108 | int64_t m_groupId; 109 | }; 110 | -------------------------------------------------------------------------------- /Client/Log.cpp: -------------------------------------------------------------------------------- 1 | #include "Log.h" 2 | 3 | QFile* Log::gFileLog = nullptr; 4 | QtMessageHandler Log::gDefaultHandler = nullptr; 5 | 6 | void Log::init() 7 | { 8 | QDateTime dateTime = QDateTime::currentDateTime(); 9 | QString timeStr = dateTime.toString("[yyyy-MM-dd][hh_mm_ss_zzz]"); 10 | QString filePath = QString("./log/log_%1.txt").arg(timeStr); 11 | 12 | gFileLog = new QFile(filePath); 13 | if (!gFileLog->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) 14 | { 15 | delete gFileLog; 16 | gFileLog = nullptr; 17 | return; 18 | } 19 | // 初始化自定义日志处理函数myMessageOutput 20 | gDefaultHandler = qInstallMessageHandler(messageOutput); 21 | } 22 | 23 | void Log::deinit() 24 | { 25 | if (gFileLog != nullptr) 26 | { 27 | gFileLog->close(); 28 | delete gFileLog; 29 | gFileLog = nullptr; 30 | } 31 | } 32 | 33 | QString Log::getTimeStr() 34 | { 35 | QDateTime dateTime = QDateTime::currentDateTime(); 36 | QString timeStr = dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz"); 37 | return timeStr; 38 | } 39 | 40 | QString Log::getFileName(const char* file) 41 | { 42 | QString fileStr = file; 43 | QString fileNameStr = fileStr.right(fileStr.size() - fileStr.lastIndexOf("\\") - 1); 44 | return fileNameStr; 45 | } 46 | 47 | void Log::messageOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg) 48 | { 49 | if (gFileLog) 50 | { 51 | QTextStream tWrite(gFileLog); 52 | tWrite << msg << "\n"; 53 | gDefaultHandler(type, context, msg); 54 | } 55 | else 56 | { 57 | fprintf(stderr, "%s\n", msg.toStdString().c_str()); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Client/Log.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | // 日志格式统一规范 12 | // [时间] [等级] [文件名] [函数名] [行数] [内容] 13 | class Log 14 | { 15 | public: 16 | enum LogLevel 17 | { 18 | Debug, 19 | Info, 20 | Waring, 21 | Err, 22 | }; 23 | 24 | public: 25 | Log() 26 | { 27 | } 28 | 29 | static void init(); 30 | static void deinit(); 31 | static QString getTimeStr(); 32 | static QString getFileName(const char* file); 33 | static void messageOutput(QtMsgType type, const QMessageLogContext& context, const QString& msg); 34 | 35 | public: 36 | static QFile* gFileLog; 37 | static QtMessageHandler gDefaultHandler; 38 | }; 39 | 40 | #define LogFunc LogD << "called."; 41 | 42 | #define getLogTimeStr Log::getTimeStr().toStdString().c_str() 43 | #define getLogFileStr Log::getFileName(__FILE__).toStdString().c_str() 44 | 45 | #define LogD \ 46 | qDebug().nospace() << "[" << getLogTimeStr << "]" \ 47 | << "[" \ 48 | << "debug" \ 49 | << "]" \ 50 | << "[" << getLogFileStr << "." << __FUNCTION__ << "." << __LINE__ << "] " 51 | 52 | #define LogI \ 53 | qDebug().nospace() << "[" << getLogTimeStr << "]" \ 54 | << "[" \ 55 | << "info" \ 56 | << "]" \ 57 | << "[" << getLogFileStr << "." << __FUNCTION__ << "." << __LINE__ << "] " 58 | 59 | #define LogW \ 60 | qDebug().nospace() << "[" << getLogTimeStr << "]" \ 61 | << "[" \ 62 | << "warn" \ 63 | << "]" \ 64 | << "[" << getLogFileStr << "." << __FUNCTION__ << "." << __LINE__ << "] " 65 | 66 | #define LogE \ 67 | qDebug().nospace() << "[" << getLogTimeStr << "]" \ 68 | << "[" \ 69 | << "err" \ 70 | << "]" \ 71 | << "[" << getLogFileStr << "." << __FUNCTION__ << "." << __LINE__ << "] " 72 | 73 | #define SplitStr "---------- ---------- ---------- ---------- ----------" -------------------------------------------------------------------------------- /Client/LoginRegWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "MainWnd.h" 13 | 14 | // 登录和注册窗口 15 | class LoginRegWnd : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | LoginRegWnd(QWidget* p = nullptr); 20 | ~LoginRegWnd(); 21 | 22 | void regSignalSlot(); 23 | 24 | // to enable qss 25 | void paintEvent(QPaintEvent* event); 26 | public slots: 27 | void mouseMoveEvent(QMouseEvent* event); 28 | void mousePressEvent(QMouseEvent* event); 29 | void mouseReleaseEvent(QMouseEvent* event); 30 | 31 | void onCloseWnd(); 32 | void onMinWnd(); 33 | void onRegLoginSel(bool isSel = false); 34 | void onRegLoginBtnClicked(); 35 | 36 | public: 37 | QWidget* m_centerWnd; 38 | 39 | QVBoxLayout* m_vLayout; 40 | 41 | QWidget* m_topWnd; 42 | QVBoxLayout* m_vTopLayout; 43 | QHBoxLayout* m_hTopLayout; 44 | 45 | QLabel* m_titleLabel; 46 | QPushButton* m_minBtn; 47 | QPushButton* m_closeBtn; 48 | QPushButton* m_settingBtn; 49 | 50 | QWidget* m_bottomWnd; 51 | QHBoxLayout* m_hBottomLayout1; 52 | QVBoxLayout* m_vBottomLayout; 53 | QLineEdit* m_accuntEdit; 54 | QLineEdit* m_pwdEdit; 55 | QPushButton* m_regOrLoginBtn; 56 | 57 | QHBoxLayout* m_hBottomLayout2; 58 | QCheckBox* m_regLoginCB; 59 | QCheckBox* m_remmerPwdCB; 60 | 61 | MainWnd* m_mainWnd = nullptr; 62 | 63 | // 用于控制窗口的移动 64 | bool m_bPress = false; 65 | QPoint m_poPress; 66 | 67 | bool m_bReg = false; 68 | }; -------------------------------------------------------------------------------- /Client/NetClientUtils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | #include "json/CJsonObject.hpp" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define msg_type_req 1 12 | #define msg_type_resp 2 13 | #define msg_type_push 3 14 | #define msg_type_broadcast 4 15 | #define msg_type_push_s 5 16 | 17 | 18 | class NetClientUtils : public QObject 19 | { 20 | Q_OBJECT 21 | private: 22 | using NetEventCall = std::function; 23 | class NetEventCaller 24 | { 25 | public: 26 | NetEventCaller(NetEventCall call, std::string rand, std::string cmd) : call(call), m_rand(rand), m_cmd(cmd) 27 | { 28 | m_sendTime = QTime::currentTime().msec(); 29 | } 30 | 31 | public: 32 | NetEventCall call; 33 | time_t m_sendTime; 34 | std::string m_rand; 35 | std::string m_cmd; 36 | }; 37 | 38 | private: 39 | NetClientUtils(); 40 | ~NetClientUtils(); 41 | 42 | public: 43 | static void init(); 44 | static void deinit(); 45 | 46 | static NetClientUtils* getUtils(); 47 | static std::string getRandString(); 48 | 49 | static QWebSocket* getWebSock() 50 | { 51 | return getUtils()->m_webSock; 52 | } 53 | 54 | static bool getConn() 55 | { 56 | return getUtils()->m_bConn; 57 | } 58 | 59 | static bool setConn(bool bConn) 60 | { 61 | getUtils()->m_bConn = bConn; 62 | } 63 | 64 | static bool send(const QString& message); 65 | static void regMsgCall(QString cmd, NetEventCall call); 66 | static bool transfer(neb::CJsonObject& msg); 67 | static bool request(const std::string& cmd, neb::CJsonObject& json); 68 | static bool request(const std::string& cmd, neb::CJsonObject& json, NetEventCall call); 69 | 70 | public slots: 71 | void onConnected(); 72 | void onDisconnected(); 73 | void onRecvMsg(const QString& message); 74 | void onTimer(); 75 | 76 | protected: 77 | static NetClientUtils* m_netClientUtils; 78 | QWebSocket* m_webSock; 79 | 80 | // callers; 81 | std::list m_netEventCallers; 82 | 83 | // timer; 84 | QTimer* m_timer; 85 | bool m_bConn; 86 | }; 87 | -------------------------------------------------------------------------------- /Client/PictureToolWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class PictureToolWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | PictureToolWnd(QWidget* p = nullptr); 17 | 18 | void mouseMoveEvent(QMouseEvent* event); 19 | void mousePressEvent(QMouseEvent* event); 20 | void mouseReleaseEvent(QMouseEvent* event); 21 | 22 | public slots: 23 | void slotUploadBtnClicked(); 24 | void slotCancelBtnClicked(); 25 | void slotDetermineBtnClicked(); 26 | void slotCloseWnd(); 27 | void SlotMinWnd(); 28 | 29 | public: 30 | QWidget* m_centerWnd; 31 | 32 | QLabel* m_picLable; 33 | QPixmap m_headImg; 34 | QString m_filePath; 35 | 36 | QVBoxLayout* m_vLayout; 37 | 38 | QHBoxLayout* m_hLayout1; 39 | QPushButton* m_minBtn; 40 | QPushButton* m_closeBtn; 41 | 42 | QHBoxLayout* m_hLayout2; 43 | 44 | QPushButton* m_determineBtn; 45 | QPushButton* m_cancelBtn; 46 | QPushButton* m_uploadBtn; 47 | 48 | bool m_bPress = false; 49 | QPoint m_poPress; 50 | }; 51 | -------------------------------------------------------------------------------- /Client/ScreenShotToolBarWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "def.h" 2 | #include "ScreenShotToolBarWnd.h" 3 | 4 | ScreenShotToolBarWnd::ScreenShotToolBarWnd(QWidget* p /*= nullptr*/) 5 | { 6 | LogFunc; 7 | setObjectName("QScreenShotToolBarWnd"); 8 | 9 | setWindowFlags(Qt::FramelessWindowHint); 10 | setStyleSheet("background-color:rgb(234,238,245);"); 11 | m_hLayout = new QHBoxLayout(); 12 | m_hLayout->setContentsMargins(7, 7, 7, 7); 13 | setLayout(m_hLayout); 14 | setFixedHeight(30); 15 | 16 | m_saveBtn = new QPushButton(); 17 | m_saveBtn->setFixedSize(16, 16); 18 | m_saveBtn->setIconSize(QSize(16, 16)); 19 | m_saveBtn->setIcon(QPixmap("./img/saveShot.png")); 20 | 21 | m_closeBtn = new QPushButton(); 22 | m_closeBtn->setFixedSize(16, 16); 23 | m_closeBtn->setIconSize(QSize(16, 16)); 24 | m_closeBtn->setIcon(QPixmap("./img/closeShot.png")); 25 | 26 | m_copyBtn = new QPushButton(); 27 | m_copyBtn->setFixedSize(16, 16); 28 | m_copyBtn->setIconSize(QSize(16, 16)); 29 | m_copyBtn->setIcon(QPixmap("./img/copyShot.png")); 30 | 31 | m_hLayout->addWidget(m_saveBtn); 32 | m_hLayout->addWidget(m_closeBtn); 33 | m_hLayout->addWidget(m_copyBtn); 34 | } 35 | -------------------------------------------------------------------------------- /Client/ScreenShotToolBarWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | class ScreenShotToolBarWnd : public QWidget 8 | { 9 | Q_OBJECT 10 | public: 11 | ScreenShotToolBarWnd(QWidget* p = nullptr); 12 | 13 | public: 14 | QHBoxLayout* m_hLayout; 15 | QPushButton* m_saveBtn; 16 | QPushButton* m_copyBtn; 17 | QPushButton* m_closeBtn; 18 | }; 19 | -------------------------------------------------------------------------------- /Client/ScreenShotWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "ScreenShotToolBarWnd.h" 10 | 11 | class ScreenShotWnd : public QWidget 12 | { 13 | Q_OBJECT 14 | public: 15 | ScreenShotWnd(QWidget* p = nullptr); 16 | ~ScreenShotWnd(); 17 | public slots: 18 | // 复制截图 19 | void slotCopyScreenShot(); 20 | // 保存截图 21 | void slotSaveScreenShot(); 22 | // 退出截图 23 | void slotExitSccreenShot(); 24 | 25 | protected: 26 | void showEvent(QShowEvent*) override; 27 | void mousePressEvent(QMouseEvent* event) override; 28 | void mouseMoveEvent(QMouseEvent* event) override; 29 | void mouseReleaseEvent(QMouseEvent* event) override; 30 | void paintEvent(QPaintEvent* event) override; 31 | 32 | void contextMenuEvent(QContextMenuEvent*) override; //--右键菜单事件 33 | void keyPressEvent(QKeyEvent* e) override; //--按键事件 34 | public: 35 | QPixmap m_fullScreenPixmap; 36 | 37 | private: 38 | // 鼠标开始位置 39 | QPoint m_begPos; 40 | // 鼠标结束位置 41 | QPoint m_endPos; 42 | 43 | // 鼠标开始全局位置 44 | QPoint m_globalBegPos; 45 | // 鼠标结束全局位置 46 | QPoint m_globalEndPos; 47 | 48 | // 矩形截图区域 49 | QRect m_screenShotRect; 50 | // 左键是否按下 51 | bool m_leftBtnPress; 52 | 53 | // 右键菜单 54 | QMenu* m_RightBtnMenu; 55 | 56 | QScreen* m_screen; 57 | 58 | ScreenShotToolBarWnd* m_toolBarWnd; 59 | 60 | bool m_isPainting; 61 | bool m_patingSuc; 62 | }; 63 | -------------------------------------------------------------------------------- /Client/SelectGroupFriendWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "SelectGroupFriendWnd.h" 2 | #include "FindFriendOrGroupWnd.h" 3 | #include "SelfSplit.h" 4 | #include 5 | #include 6 | 7 | #include "StyleSheetMgr.h" 8 | 9 | SelectGroupFriendWnd::SelectGroupFriendWnd(QWidget* p) : QWidget(p) 10 | { 11 | LogFunc; 12 | m_vMainLayout = new QVBoxLayout; 13 | setLayout(m_vMainLayout); 14 | m_vMainLayout->setContentsMargins(5, 5, 5, 5); 15 | 16 | m_centerWnd = new QWidget; 17 | m_vMainLayout->addWidget(m_centerWnd); 18 | 19 | m_centerWnd->setObjectName("QSelectAddGroupOrAddFriendWnd"); 20 | QStyleSheetObject object; 21 | object.m_qssFileName = "./stylesheet/" + m_centerWnd->objectName() + ".qss"; 22 | object.m_widget = m_centerWnd; 23 | StyleSheetMgr::getMgr()->reg(object.m_qssFileName, object); 24 | 25 | setAttribute(Qt::WA_TranslucentBackground); 26 | setWindowFlags(Qt::FramelessWindowHint); 27 | 28 | // setFixedSize(120, 100); 29 | 30 | m_vCenterLayout = new QVBoxLayout; 31 | m_vCenterLayout->setContentsMargins(5, 5, 5, 5); 32 | m_vCenterLayout->setSpacing(0); 33 | 34 | m_addContactsOrGroupBtn = new QPushButton("添加好友或群"); 35 | m_createGroupBtn = new QPushButton("创建群聊"); 36 | 37 | m_vCenterLayout->addWidget(m_addContactsOrGroupBtn); 38 | m_vCenterLayout->addWidget(m_createGroupBtn); 39 | 40 | m_centerWnd->setLayout(m_vCenterLayout); 41 | 42 | //m_findFriendOrGroupWnd = new FindFriendOrGroupWnd(); 43 | //m_findFriendOrGroupWnd->hide(); 44 | 45 | //m_crateGroupWnd = new CreateGroupWnd(); 46 | //m_crateGroupWnd->hide(); 47 | 48 | //connect(m_addContactsOrGroupBtn, SIGNAL(clicked()), this, SLOT(slotAddContactsOrGroupBtnClick())); 49 | //connect(m_createGroupBtn, SIGNAL(clicked()), this, SLOT(slotCreateGroup())); 50 | } 51 | 52 | void SelectGroupFriendWnd::slotAddContactsOrGroupBtnClick() 53 | { 54 | //if (m_findFriendOrGroupWnd != nullptr) 55 | //{ 56 | // m_findFriendOrGroupWnd->showNormal(); 57 | // m_findFriendOrGroupWnd->activateWindow(); 58 | //} 59 | } 60 | 61 | void SelectGroupFriendWnd::slotCreateGroup() 62 | { 63 | //if (m_crateGroupWnd != nullptr) 64 | //{ 65 | // m_crateGroupWnd->updateData(); 66 | // m_crateGroupWnd->show(); 67 | //} 68 | } 69 | 70 | bool SelectGroupFriendWnd::event(QEvent* event) 71 | { 72 | if (event->type() == QEvent::ActivationChange) 73 | { 74 | if (QApplication::activeWindow() != this) 75 | { 76 | this->hide(); 77 | } 78 | } 79 | return QWidget::event(event); 80 | } 81 | -------------------------------------------------------------------------------- /Client/SelectGroupFriendWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "FindFriendOrGroupWnd.h" 11 | #include "CreateGroupWnd.h" 12 | 13 | class SelectGroupFriendWnd : public QWidget 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | SelectGroupFriendWnd(QWidget* p); 19 | 20 | bool event(QEvent* event); 21 | public slots: 22 | void slotAddContactsOrGroupBtnClick(); 23 | void slotCreateGroup(); 24 | 25 | protected: 26 | QVBoxLayout* m_vMainLayout; 27 | QWidget* m_centerWnd; 28 | QVBoxLayout* m_vCenterLayout; 29 | QPushButton* m_addContactsOrGroupBtn; 30 | QPushButton* m_createGroupBtn; 31 | FindFriendOrGroupWnd* m_findFriendOrGroupWnd; 32 | CreateGroupWnd* m_crateGroupWnd; 33 | }; -------------------------------------------------------------------------------- /Client/SelectMoreWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "SelectMoreWnd.h" 2 | #include 3 | 4 | SelectMoreWnd::SelectMoreWnd(QWidget* p) : QWidget(p) 5 | { 6 | LogFunc; 7 | setObjectName("QSelectMoreWnd"); 8 | setWindowFlags(Qt::FramelessWindowHint); 9 | setAttribute(Qt::WA_StyledBackground); 10 | setFixedSize(135, 40); 11 | 12 | m_vLayout = new QVBoxLayout(); 13 | setLayout(m_vLayout); 14 | setStyleSheet("background-color:#2e2e2e;"); 15 | 16 | m_settingBtn = new QPushButton("设置"); 17 | m_vLayout->addWidget(m_settingBtn); 18 | m_settingBtn->setStyleSheet("background-color:#2e2e2e;color:white;border:0px;"); 19 | } 20 | 21 | bool SelectMoreWnd::event(QEvent* event) 22 | { 23 | if (event->type() == QEvent::ActivationChange && QApplication::activeWindow() != this) 24 | { 25 | this->hide(); 26 | } 27 | return QWidget::event(event); 28 | } -------------------------------------------------------------------------------- /Client/SelectMoreWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class SelectMoreWnd : public QWidget 10 | { 11 | Q_OBJECT 12 | protected: 13 | bool event(QEvent* event); 14 | 15 | public: 16 | SelectMoreWnd(QWidget* p = nullptr); 17 | 18 | public: 19 | QVBoxLayout* m_vLayout; 20 | // ¹ØÓÚ°´Å¥ 21 | QPushButton* m_settingBtn; 22 | }; 23 | -------------------------------------------------------------------------------- /Client/SelfLabel.cpp: -------------------------------------------------------------------------------- 1 | #include "SelfLabel.h" 2 | 3 | SelfLabel::SelfLabel(QWidget* parent /*= nullptr*/, Qt::WindowFlags wndFlags /*= Qt::WindowFlags()*/) : QLabel(parent, wndFlags) 4 | { 5 | LogFunc; 6 | setObjectName("QSelfLabel"); 7 | } 8 | 9 | SelfLabel::SelfLabel(const QString& text, QWidget* parent /*= nullptr*/, Qt::WindowFlags wndFlags /*= Qt::WindowFlags()*/) : QLabel(text, parent, wndFlags) 10 | { 11 | LogFunc; 12 | setObjectName("QSelfLabel"); 13 | } 14 | 15 | void SelfLabel::mousePressEvent(QMouseEvent* ev) 16 | { 17 | emit clicked(); 18 | } 19 | -------------------------------------------------------------------------------- /Client/SelfLabel.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | 7 | // 自定义Label控件,Label被点击时候发出信号 8 | class SelfLabel : public QLabel 9 | { 10 | Q_OBJECT 11 | // 构造函数与析构函数 12 | public: 13 | explicit SelfLabel(QWidget* parent = nullptr, Qt::WindowFlags wndFlags = Qt::WindowFlags()); 14 | explicit SelfLabel(const QString& text, QWidget* parent = nullptr, Qt::WindowFlags wndFlags = Qt::WindowFlags()); 15 | signals: 16 | void clicked(); 17 | 18 | protected: 19 | void mousePressEvent(QMouseEvent* ev) override; 20 | }; 21 | -------------------------------------------------------------------------------- /Client/SelfSplit.cpp: -------------------------------------------------------------------------------- 1 | #include "SelfSplit.h" 2 | 3 | SelfSplit::SelfSplit(QWidget* p /*= nullptr*/, QSimpleSplitDirection direct /* Direction_H */) 4 | { 5 | setObjectName("QSimpleSplit"); 6 | setAttribute(Qt::WA_StyledBackground); 7 | // 设置一些样式, 无焦点, 无边框 8 | setFocusPolicy(Qt::NoFocus); 9 | setWindowFlags(Qt::FramelessWindowHint); 10 | 11 | if (direct == Direction_H) 12 | { 13 | setFixedHeight(1); 14 | } 15 | else 16 | { 17 | setFixedWidth(1); 18 | } 19 | 20 | // 设置分割线的颜色 21 | // 灰色的分割线 22 | // setStyleSheet("background-color:#E7E7E;border:none"); 23 | 24 | // 红色的分割线 25 | setStyleSheet("background-color:#828790;border:0px"); 26 | } 27 | -------------------------------------------------------------------------------- /Client/SelfSplit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | 7 | class SelfSplit : public QWidget 8 | { 9 | Q_OBJECT 10 | public: 11 | enum QSimpleSplitDirection 12 | { 13 | Direction_V = 0, // 水平方向 14 | Direction_H, 15 | }; 16 | 17 | SelfSplit(QWidget* p = nullptr, QSimpleSplitDirection direct = Direction_H); 18 | }; -------------------------------------------------------------------------------- /Client/SelfSwitchButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * 关于参考,原文地址,代码从此处演化: 5 | https://blog.csdn.net/weixin_39572794/article/details/110516773 6 | * 由于博客内源码比较乱,重新整理,为了适应本项目,自己对此代码做出相应的修改, 7 | * 特此标注:特此感谢此博文作者的贡献 8 | */ 9 | 10 | #include "def.h" 11 | 12 | #include 13 | #include 14 | 15 | class SelfSwitchButton : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | SelfSwitchButton(QWidget *parent = nullptr); 20 | ~SelfSwitchButton(); 21 | 22 | protected: 23 | void paintEvent(QPaintEvent *e); 24 | void resizeEvent(QResizeEvent *e); 25 | void mousePressEvent(QMouseEvent *e); 26 | void mouseMoveEvent(QMouseEvent *e); 27 | void mouseReleaseEvent(QMouseEvent *e); 28 | 29 | public: 30 | void drawBg(QPainter &painter); // 绘制背景 31 | void drawSlidBlock(QPainter &painter); // 绘制滑块 32 | void drawText(QPainter &painter); // 绘制文字 33 | signals: 34 | void stateChange(bool state); 35 | 36 | public: 37 | QColor m_bgColorOn; // 开状态时的背景颜色 38 | QColor m_bgColorOff; // 关状态时的背景颜色 39 | QColor m_sliderColor; 40 | QColor m_sliderColorOn; // 开状态时滑块的背景颜色 41 | QColor m_sliderColorOff; // 关状态时滑块的背景颜色 42 | QColor m_textColorOn; // 开状态时文字颜色 43 | QColor m_textColorOff; // 关状态时文字颜色 44 | 45 | QPoint m_startPoint; // 滑块移动的起始点 46 | QPoint m_endPoint; // 滑块移动的终点 47 | QPoint m_centerPoint; // 滑块移动的中间某点 48 | 49 | QString m_strText; // 文字内容 50 | 51 | int m_mouseX; 52 | 53 | bool m_bPress; // 左键是否按下 54 | bool m_bSwitch; // 开关状态:开true,关false 55 | }; -------------------------------------------------------------------------------- /Client/SelfTextEdit.cpp: -------------------------------------------------------------------------------- 1 | #include "def.h" 2 | #include "SelfTextEdit.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | SelfTextEdit::SelfTextEdit(QWidget *parent /*= nullptr*/) : QTextEdit(parent) 9 | { 10 | LogFunc; 11 | setAcceptRichText(true); 12 | } 13 | 14 | void SelfTextEdit::insertFromMimeData(const QMimeData *source) 15 | { 16 | if (source->hasImage()) 17 | { 18 | const QMimeData *mime = QApplication::clipboard()->mimeData(); 19 | if (mime->hasImage()) 20 | { 21 | QImage image = qvariant_cast(mime->imageData()); 22 | textCursor().insertImage(image); 23 | return; 24 | } 25 | } 26 | 27 | QTextEdit::insertFromMimeData(source); 28 | } 29 | -------------------------------------------------------------------------------- /Client/SelfTextEdit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class SelfTextEdit : public QTextEdit 6 | { 7 | public: 8 | SelfTextEdit(QWidget *parent = nullptr); 9 | 10 | void insertFromMimeData(const QMimeData *source); 11 | }; 12 | -------------------------------------------------------------------------------- /Client/SessionToolBar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include "EmoijWnd.h" 7 | // #include "VoiceTelphoneWnd.h" 8 | #include "ScreenShotWnd.h" 9 | 10 | class SessionToolBar : public QWidget 11 | { 12 | Q_OBJECT 13 | public: 14 | SessionToolBar(QWidget* p = nullptr); 15 | public slots: 16 | void slotEmojiBtnClick(); 17 | void slotScreenshotBtnClick(); 18 | 19 | public: 20 | QHBoxLayout* m_hLayout; 21 | EmoijWnd* m_emoijWnd; 22 | QPushButton* m_emojiBtn; 23 | QPushButton* m_screenshotBtn; 24 | QPushButton* m_sendFileBtn; 25 | QPushButton* m_voiceTelphoneBtn; 26 | ScreenShotWnd* m_screenShotWnd = nullptr; 27 | // VoiceTelphoneWnd* m_phoneWnd; 28 | }; 29 | -------------------------------------------------------------------------------- /Client/SessionWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include //窗口列表 10 | 11 | #include "TopWnd.h" 12 | #include "SessionToolBar.h" 13 | #include "GroupInfoWnd.h" 14 | #include 15 | #include 16 | 17 | // 支持黏贴图片的文本框 18 | #include "SelfTextEdit.h" 19 | 20 | /* 21 | * 会话的窗口 sesId作用,右边信息栏的小窗口选项也有一个id,通过id关联彼此信息 22 | * 来修改对应的窗口信息 23 | */ 24 | 25 | class SessionWnd : public QWidget 26 | { 27 | // 添加消息映射支持 28 | Q_OBJECT 29 | public: 30 | // 会话窗口 31 | SessionWnd(QWidget* p = nullptr); 32 | ~SessionWnd(); 33 | public slots: 34 | void slotSendTextBtnClick(); 35 | void slotEmoijClicked(QString str); 36 | void slotMoreBtnClick(); 37 | void slotVoiceTelPhoneBtnClick(); 38 | void slotUpdateGroupName(QString groupName); 39 | 40 | protected: 41 | void dragEnterEvent(QDragEnterEvent* event); 42 | void dropEvent(QDropEvent* event); 43 | 44 | QString getFileSize(QFileInfo& fileInfo); 45 | 46 | void resizeEvent(QResizeEvent* event) override; 47 | 48 | public: 49 | void sendMsgToUser(neb::CJsonObject json, QString msgText); 50 | 51 | void sendMsgToGroup(neb::CJsonObject json, QString msgText); 52 | 53 | void setTitle(QString title) 54 | { 55 | m_sesTopWnd->setTitle(title); 56 | } 57 | 58 | void dealMsgTime(); 59 | 60 | public: 61 | // QHBoxLayout* m_hLayout; 62 | // more按钮按下时候会显示这个窗口 63 | GroupInfoWnd* m_groupInfoWnd; 64 | // 窗口布局管理 65 | QVBoxLayout* m_vLayout; 66 | // 会话的上放窗口 67 | TopWnd* m_sesTopWnd; 68 | // 窗口列表信息 69 | 70 | QListWidget* m_MsgWndList; 71 | 72 | // 消息会话中ToolBar 73 | SessionToolBar* m_sesToolBar; 74 | // 需要发送的文字 75 | SelfTextEdit* m_sendTextEdit; 76 | // 用于发送文字的按钮 77 | QPushButton* m_sendTextBtn; 78 | // 用于控制 79 | QHBoxLayout* m_hLayout1; 80 | 81 | // 会话id 82 | qint64 m_sesId; 83 | // 会话名字 84 | QString m_name; 85 | // 向何人发送 86 | int64_t m_recvId; 87 | 88 | // 上次显示时间日期的时间 89 | QDateTime m_lastMsgDateTime; 90 | 91 | // 是否是群会话 92 | bool m_isGroupSes = false; 93 | bool m_isClicked = false; 94 | }; -------------------------------------------------------------------------------- /Client/SettingWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "def.h" 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "SelfSplit.h" 9 | #include 10 | #include 11 | 12 | class SettingWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | SettingWnd(QWidget* p = nullptr); 17 | 18 | protected: 19 | void mouseMoveEvent(QMouseEvent* event); 20 | void mousePressEvent(QMouseEvent* event); 21 | void mouseReleaseEvent(QMouseEvent* event); 22 | 23 | void paintEvent(QPaintEvent* event); 24 | 25 | public slots: 26 | void slotClickedCloseBtn(); 27 | void slotClickedMinBtn(); 28 | 29 | public: 30 | bool m_leftBtnPressed = false; 31 | QPoint m_LeftBtnPressPoint; 32 | 33 | QWidget* m_centerWnd; 34 | QVBoxLayout* m_vLayout; 35 | 36 | QHBoxLayout* m_hTitleLayout; 37 | QPushButton* m_minBtn; 38 | QPushButton* m_closeBtn; 39 | 40 | // QHBoxLayout* m_hContentLayout; 41 | // QStackedLayout* m_rightLayout; 42 | // QWidget* m_aboutWnd; 43 | 44 | QHBoxLayout* m_hVerLayout; 45 | QLabel* m_keyVerLabel; 46 | QLabel* m_valueVerLabel; 47 | 48 | // Ö÷ÌâÉèÖà 49 | QHBoxLayout* m_themeLayout; 50 | QLabel* m_keyThemeLabel; 51 | QComboBox* m_valueThemeComboBox; 52 | }; 53 | -------------------------------------------------------------------------------- /Client/StyleSheetMgr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class QStyleSheetObject 10 | { 11 | public: 12 | QWidget* m_widget; // 窗口 13 | QString m_qssFileName; 14 | }; 15 | 16 | typedef std::vector QStyleSheetObjectVct; 17 | 18 | class QStyleSheetObectWatcher 19 | { 20 | public: 21 | QFileSystemWatcher* m_watcher; 22 | QStyleSheetObjectVct m_objectVct; 23 | }; 24 | 25 | class StyleSheetMgr : public QObject 26 | { 27 | Q_OBJECT 28 | private: 29 | StyleSheetMgr(QObject* parent = nullptr); 30 | ~StyleSheetMgr(); 31 | static StyleSheetMgr* m_mgr; 32 | 33 | public: // 成员函数 34 | void reg(QString wndObjectName, QStyleSheetObject object); 35 | 36 | void reg(QString wndObjectName, QString qssFileName, QWidget* wnd); 37 | 38 | void unReg(QString wndObjectName, QWidget* wnd); 39 | 40 | static StyleSheetMgr* getMgr(); 41 | 42 | static void initMgr() 43 | { 44 | getMgr(); 45 | } 46 | 47 | static void exitMgr() 48 | { 49 | if (m_mgr) 50 | delete m_mgr; 51 | } 52 | 53 | public: 54 | std::map m_map; 55 | }; 56 | -------------------------------------------------------------------------------- /Client/ToolWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #include "SelfLabel.h" 13 | #include "UserInfoWnd.h" 14 | #include "PictureToolWnd.h" 15 | #include 16 | #include "SelectMoreWnd.h" 17 | 18 | // 最右边工具栏窗口 19 | // 消息,用户,群组,设置 20 | class ToolWnd : public QWidget 21 | { 22 | // 添加消息映射支持 23 | Q_OBJECT 24 | public: 25 | // 工具栏窗口 26 | ToolWnd(QWidget* p = nullptr); 27 | signals: 28 | void signalToolWndPageChanged(int num); 29 | public slots: 30 | void slotOnClickMsgBtn(); 31 | void slotOnClickContactsBtn(); 32 | void slotOnClickHeadUrlLabel(); 33 | void slotOnClickChangeHeadImgBtn(); 34 | void slotOnClickGroupsBtn(); 35 | void slotOnClickMoreBtn(); 36 | 37 | public: 38 | int m_selectIndex; 39 | QVBoxLayout* m_vBoxLayout; 40 | QPushButton* m_msgBtn; 41 | QPushButton* m_contactsBtn; 42 | QPushButton* m_groupsBtn; 43 | SelfLabel* m_headUrlLabel; 44 | QVector m_btnVct; 45 | UserInfoWnd* m_userInfoWnd; 46 | PictureToolWnd* m_pictureToolWnd; 47 | QPixmap m_headImg; 48 | QPushButton* m_moreBtn; 49 | SelectMoreWnd* m_selectMoreWnd; 50 | }; -------------------------------------------------------------------------------- /Client/TopWnd.cpp: -------------------------------------------------------------------------------- 1 | #include "TopWnd.h" 2 | 3 | TopWnd::TopWnd(QWidget* p /*= nullptr*/) : QWidget(p) 4 | { 5 | LogFunc; 6 | m_vLayout = new QVBoxLayout(this); 7 | m_vLayout->setContentsMargins(0, 0, 0, 0); 8 | m_vLayout->setSpacing(0); 9 | 10 | m_hLayout1 = new QHBoxLayout(); 11 | 12 | m_hLayout1->setContentsMargins(0, 0, 0, 0); 13 | m_hLayout1->setSpacing(5); 14 | 15 | m_minBtn = new QPushButton(this); 16 | m_minBtn->setIcon(QPixmap("./img/minBtn_.png")); 17 | m_minBtn->setIconSize(QSize(20, 20)); 18 | m_maxBtn = new QPushButton(this); 19 | m_maxBtn->setIcon(QPixmap("./img/normalBtn_.png")); 20 | m_maxBtn->setIconSize(QSize(20, 20)); 21 | m_closeBtn = new QPushButton(this); 22 | m_closeBtn->setIcon(QPixmap("./img/closeBtn_.png")); 23 | m_closeBtn->setIconSize(QSize(20, 20)); 24 | 25 | m_minBtn->setFixedSize(20, 20); 26 | m_maxBtn->setFixedSize(20, 20); 27 | m_closeBtn->setFixedSize(20, 20); 28 | 29 | // m_minBtn->setStyleSheet(""); 30 | 31 | m_hLayout1->addStretch(); 32 | m_hLayout1->addWidget(m_minBtn); 33 | m_hLayout1->addWidget(m_maxBtn); 34 | m_hLayout1->addWidget(m_closeBtn); 35 | 36 | m_hLayout1->setContentsMargins(0, 5, 0, 0); 37 | m_hLayout1->addSpacing(15); 38 | m_vLayout->addLayout(m_hLayout1); 39 | 40 | m_hLayout2 = new QHBoxLayout(); 41 | m_hLayout2->setContentsMargins(0, 0, 0, 0); 42 | m_hLayout2->setSpacing(0); 43 | 44 | m_titleLabel = new QLabel(this); 45 | m_titleLabel->setFixedHeight(40); 46 | m_titleLabel->setFixedWidth(300); 47 | m_titleLabel->setText("苏果超市便民服务(234)"); 48 | m_titleLabel->setAlignment(Qt::AlignLeft); 49 | 50 | QFont font; 51 | font.setPointSize(12); 52 | m_titleLabel->setFont(font); 53 | 54 | m_moreBtn = new QPushButton(this); 55 | m_moreBtn->setFixedSize(30, 30); 56 | m_moreBtn->setIcon(QPixmap("./img/more.png")); 57 | m_moreBtn->setIconSize(QSize(30, 30)); 58 | 59 | m_hLayout2->addSpacing(30); 60 | m_hLayout2->addWidget(m_titleLabel); 61 | m_hLayout2->addStretch(); 62 | m_hLayout2->addWidget(m_moreBtn); 63 | 64 | m_hLayout2->setContentsMargins(0, 0, 0, 0); 65 | m_hLayout2->addSpacing(15); 66 | m_vLayout->addLayout(m_hLayout2); 67 | 68 | setFixedHeight(65); 69 | setAttribute(Qt::WA_StyledBackground); 70 | setMouseTracking(true); 71 | } 72 | -------------------------------------------------------------------------------- /Client/TopWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "json/CJsonObject.hpp" 11 | 12 | class TopWnd : public QWidget 13 | { 14 | // 添加消息映射支持 15 | Q_OBJECT 16 | public: 17 | // 会话窗口 18 | TopWnd(QWidget* p = nullptr); 19 | 20 | QPushButton* getMoreBtn() 21 | { 22 | return m_moreBtn; 23 | } 24 | 25 | QPushButton* getMinBtn() 26 | { 27 | return m_minBtn; 28 | } 29 | 30 | QPushButton* getMaxBtn() 31 | { 32 | return m_maxBtn; 33 | } 34 | 35 | QPushButton* getCloseBtn() 36 | { 37 | return m_closeBtn; 38 | } 39 | 40 | void setTitle(const QString& title) 41 | { 42 | m_titleLabel->setText(title); 43 | } 44 | 45 | protected: 46 | QVBoxLayout* m_vLayout; 47 | QHBoxLayout* m_hLayout1; 48 | QHBoxLayout* m_hLayout2; 49 | 50 | QPushButton* m_minBtn; 51 | QPushButton* m_maxBtn; 52 | QPushButton* m_closeBtn; 53 | 54 | QLabel* m_titleLabel; 55 | QPushButton* m_moreBtn; 56 | }; -------------------------------------------------------------------------------- /Client/UserInfoWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class UserInfoWnd : public QWidget 13 | { 14 | Q_OBJECT 15 | public: 16 | UserInfoWnd(QWidget* p = nullptr); 17 | 18 | bool event(QEvent* event); 19 | 20 | public: 21 | QVBoxLayout* m_vMainLayout; 22 | QWidget* m_centerWnd; 23 | QVBoxLayout* m_vCenterLayout; 24 | 25 | QHBoxLayout* m_hTopLayout; 26 | QVBoxLayout* m_vInfoLayout; 27 | QHBoxLayout* m_hBtnLayout; 28 | 29 | QLabel* m_usernameLabel; 30 | QLabel* m_userIdLabel; 31 | 32 | // QVBoxLayout* m_vLayout2; 33 | QLabel* m_headLabel; 34 | QPushButton* m_changeHeadImgBtn; 35 | QLabel* m_otherLabel; 36 | }; 37 | -------------------------------------------------------------------------------- /Client/VoiceTelphoneWnd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "def.h" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "json/CJsonObject.hpp" 13 | #include 14 | #include 15 | 16 | class VoiceTelphoneWnd : public QWidget 17 | { 18 | Q_OBJECT 19 | public: 20 | enum class VoiceTelphoneState 21 | { 22 | VTS_none = 0, // 初始状态 23 | VTS_call, // 打电话 24 | VTS_waitAccept, // 等待接听 25 | VTS_accept, // 接听电话 26 | VTS_phoning, // 通话中 27 | VTS_close, // 挂断电话 28 | }; 29 | 30 | public: 31 | VoiceTelphoneWnd(QWidget* p = nullptr); 32 | 33 | void regSignalSlot(); 34 | 35 | void regNetMsg(); 36 | 37 | void timerEvent(QTimerEvent* event); 38 | 39 | void playAudioFormByteArrayVct(); 40 | 41 | // 采集语音并发送到服务器,服务器再进行转发 42 | void requestSendVoiceDataToServer(QByteArray& inputByteArray); 43 | 44 | // 45 | void requestSendCallPhoneToServer(); 46 | 47 | void requestSendAcceptPhoneToServer(); 48 | 49 | void requestSendClosePhoneToServer(); 50 | 51 | // 接收到别人发送的消息 52 | void cs_msg_sendvoicemsg(neb::CJsonObject& json); 53 | 54 | // 设置 recvId 和 sesId; 55 | void setRecvIdAndSesId(int64_t recvId, int64_t sesId); 56 | 57 | // 拨打电话 58 | void callPhone(); 59 | // 挂断电话 60 | void closePhone(); 61 | // 接听电话 62 | void acceptPhone(); 63 | // cs_msg_phonemsg 64 | 65 | void cs_msg_call_phone(neb::CJsonObject& msg); 66 | void cs_msg_accept_phone(neb::CJsonObject& msg); 67 | void cs_msg_phonemsg(neb::CJsonObject& msg); 68 | void cs_msg_close_phone(neb::CJsonObject& msg); 69 | public slots: 70 | void slotOnAcceptBtnClick(); 71 | void slotOnRefuseBtnClick(); 72 | 73 | public: 74 | QAudioFormat m_format; 75 | int m_timerId; 76 | QVBoxLayout* m_vLayout; 77 | QLabel* m_headImgLabel; 78 | QLabel* m_userNameLabel; 79 | QLabel* m_statusLabel; 80 | QLabel* m_timeLabel; 81 | QHBoxLayout* m_hLayout; 82 | QPushButton* m_acceptBtn; 83 | QPushButton* m_refuseBtn; 84 | 85 | QAudioInput* m_input; 86 | QIODevice* m_inputDevice; 87 | 88 | QAudioOutput* m_output; 89 | QIODevice* m_outputDevice; // 开始播放 90 | QVector m_ByteArrayVct; 91 | 92 | QSoundEffect* m_bells; 93 | 94 | int64_t m_recvId = -1; 95 | int64_t m_sesId = -1; 96 | // 打电话时间,等待对方接听电话 97 | int64_t m_calltimeCount = 0; 98 | // 在通话的时间,显示当前已经通话的时间 99 | int64_t m_phoningTimeCount = 0; 100 | 101 | // 是否在通话中 102 | VoiceTelphoneState m_state = VoiceTelphoneState::VTS_none; 103 | }; 104 | -------------------------------------------------------------------------------- /Client/def.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #pragma execution_character_set("utf-8") 3 | 4 | 5 | #include "Log.h" 6 | #include 7 | #include 8 | 9 | // version; 10 | const QString WeChatVersion = "Version:2.0.1"; 11 | 12 | // server addr; 13 | const QString HttpFileServerAddr = "http://49.232.169.205:80/UploadDemo/UploadServlet"; 14 | const QString ChatServerAddr = "ws://127.0.0.1:5000"; -------------------------------------------------------------------------------- /Client/emoij/emoij.txt: -------------------------------------------------------------------------------- 1 | 😄|😆|😊|😃|😏|😍|😘|😚|😳|😌|😆|😁|😉|😜|😝|😀|😗|😙|😛|😴|😟|😦|😧|😮|😬|😕|😯|😑|😒|😅|😓|😥|😩|😔|😞|😖|😨|😰|😣|😢|😭|😂|😲|😱|😫|😠|😡|😤|😪|😋|😷|😎|😵|👿|😈|😐|😶|😇| -------------------------------------------------------------------------------- /Client/img/CheckBox-White.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/CheckBox-White.png -------------------------------------------------------------------------------- /Client/img/CheckBoxPressed-White.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/CheckBoxPressed-White.png -------------------------------------------------------------------------------- /Client/img/ChromeClose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/ChromeClose.png -------------------------------------------------------------------------------- /Client/img/ChromeMinimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/ChromeMinimize.png -------------------------------------------------------------------------------- /Client/img/closeBtn_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/closeBtn_.png -------------------------------------------------------------------------------- /Client/img/closeShot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/closeShot.png -------------------------------------------------------------------------------- /Client/img/closeWnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/closeWnd.png -------------------------------------------------------------------------------- /Client/img/closeWnd1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/closeWnd1.png -------------------------------------------------------------------------------- /Client/img/contactsBtnClicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/contactsBtnClicked.png -------------------------------------------------------------------------------- /Client/img/contactsBtnNomal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/contactsBtnNomal.png -------------------------------------------------------------------------------- /Client/img/copyShot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/copyShot.png -------------------------------------------------------------------------------- /Client/img/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/default.png -------------------------------------------------------------------------------- /Client/img/edit_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/edit_.png -------------------------------------------------------------------------------- /Client/img/emojiBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/emojiBtn.png -------------------------------------------------------------------------------- /Client/img/emptybg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/emptybg.png -------------------------------------------------------------------------------- /Client/img/fileicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/fileicon.png -------------------------------------------------------------------------------- /Client/img/groupBtnClicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/groupBtnClicked.png -------------------------------------------------------------------------------- /Client/img/groupBtnNomal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/groupBtnNomal.png -------------------------------------------------------------------------------- /Client/img/groupHead.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/groupHead.png -------------------------------------------------------------------------------- /Client/img/head1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/head1.png -------------------------------------------------------------------------------- /Client/img/head2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/head2.png -------------------------------------------------------------------------------- /Client/img/loading0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/loading0.gif -------------------------------------------------------------------------------- /Client/img/maxBtn_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/maxBtn_.png -------------------------------------------------------------------------------- /Client/img/maxWnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/maxWnd.png -------------------------------------------------------------------------------- /Client/img/minBtn_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/minBtn_.png -------------------------------------------------------------------------------- /Client/img/minWnd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/minWnd.png -------------------------------------------------------------------------------- /Client/img/minWnd1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/minWnd1.png -------------------------------------------------------------------------------- /Client/img/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/more.png -------------------------------------------------------------------------------- /Client/img/msgBtnClicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/msgBtnClicked.png -------------------------------------------------------------------------------- /Client/img/msgBtnNormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/msgBtnNormal.png -------------------------------------------------------------------------------- /Client/img/normalBtn_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/normalBtn_.png -------------------------------------------------------------------------------- /Client/img/other.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/other.jpg -------------------------------------------------------------------------------- /Client/img/other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/other.png -------------------------------------------------------------------------------- /Client/img/owner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/owner.png -------------------------------------------------------------------------------- /Client/img/raricon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/raricon.png -------------------------------------------------------------------------------- /Client/img/saveShot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/saveShot.png -------------------------------------------------------------------------------- /Client/img/screenshotBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/screenshotBtn.png -------------------------------------------------------------------------------- /Client/img/sendFileBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/sendFileBtn.png -------------------------------------------------------------------------------- /Client/img/settingBtn_.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/settingBtn_.png -------------------------------------------------------------------------------- /Client/img/startGroupBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/startGroupBtn.png -------------------------------------------------------------------------------- /Client/img/tmore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/tmore.png -------------------------------------------------------------------------------- /Client/img/visualTelphoneBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/visualTelphoneBtn.png -------------------------------------------------------------------------------- /Client/img/voiceTelphoneAccept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/voiceTelphoneAccept.png -------------------------------------------------------------------------------- /Client/img/voiceTelphoneBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/voiceTelphoneBtn.png -------------------------------------------------------------------------------- /Client/img/voiceTelphoneHeadImg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/voiceTelphoneHeadImg.png -------------------------------------------------------------------------------- /Client/img/voiceTelphoneRefuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/voiceTelphoneRefuse.png -------------------------------------------------------------------------------- /Client/img/wechat.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/img/wechat.ico -------------------------------------------------------------------------------- /Client/log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/log/.gitkeep -------------------------------------------------------------------------------- /Client/log/clearLog.bat: -------------------------------------------------------------------------------- 1 | del *.txt -------------------------------------------------------------------------------- /Client/music/callPhone.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/music/callPhone.wav -------------------------------------------------------------------------------- /Client/recvFile/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Client/recvFile/.gitkeep -------------------------------------------------------------------------------- /Client/stylesheet/LoginRegWnd.qss: -------------------------------------------------------------------------------- 1 | #centerWnd { 2 | background-color: rgb(249, 249, 249); 3 | border-radius: 4px; 4 | } 5 | 6 | QPushButton { 7 | color: black; 8 | border: 1px solid rgb(229, 229, 229); 9 | border-radius: 4px; 10 | border-bottom: 1px solid rgb(204, 204, 204); 11 | background-color: rgb(251, 251, 251); 12 | font-size: 15px; 13 | } 14 | 15 | QPushButton:hover { 16 | border: 1px solid rgb(229, 229, 229); 17 | border-bottom: 1px solid rgb(204, 204, 204); 18 | background-color: rgb(246, 246, 246); 19 | } 20 | 21 | QPushButton:pressed { 22 | border: 1px solid rgb(229, 229, 229); 23 | border-bottom: 1px solid rgb(229, 229, 229); 24 | background-color: rgb(245, 245, 245); 25 | } 26 | 27 | #closeBtn, 28 | #minBtn { 29 | background-color: transparent; 30 | border: 1px solid transparent; 31 | } 32 | 33 | #closeBtn:hover { 34 | background-color: rgb(229, 0, 0); 35 | border: 1px solid transparent; 36 | } 37 | 38 | #minBtn:hover { 39 | background-color: rgb(229, 229, 229); 40 | border: 1px solid transparent; 41 | } 42 | 43 | /*lineedit qss*/ 44 | 45 | QLineEdit { 46 | border-radius: 4px; 47 | border: 1px solid rgb(229, 229, 229); 48 | border-bottom: 1px solid rgb(134, 134, 134); 49 | background-color: rgb(251, 251, 251); 50 | } 51 | 52 | QLineEdit:hover { 53 | background-color: rgb(246, 246, 246); 54 | } 55 | 56 | QLineEdit:focus { 57 | border-bottom: 2px solid rgb(0, 90, 158); 58 | } 59 | 60 | 61 | /*checkbox qss*/ 62 | 63 | QCheckBox { 64 | min-height: 30px; 65 | max-height: 30px; 66 | } 67 | 68 | QCheckBox::indicator { 69 | width: 22px; 70 | height: 22px; 71 | border-radius: 5px; 72 | border: 1px solid rgb(133, 133, 133); 73 | background-color: rgb(237, 237, 237); 74 | margin-right: 5px; 75 | } 76 | 77 | QCheckBox::indicator:hover { 78 | background-color: rgb(229, 229, 229); 79 | } 80 | 81 | QCheckBox::indicator:pressed { 82 | background-color: rgb(220, 220, 220); 83 | } 84 | 85 | QCheckBox::indicator:checked { 86 | background-color: rgb(0, 90, 158); 87 | border: 1px solid rgb(0, 90, 158); 88 | color: rgb(255, 255, 255); 89 | image: url("./img/CheckBox-White.png"); 90 | } 91 | 92 | QCheckBox::indicator:checked:pressed { 93 | image: url("./img/CheckBoxPressed-White.png"); 94 | } 95 | 96 | QCheckBox:disabled { 97 | color: rgb(0, 0, 0); 98 | } 99 | 100 | QCheckBox::indicator:disabled { 101 | border: 1px solid rgb(187, 187, 187); 102 | background-color: rgb(0, 0, 0); 103 | } -------------------------------------------------------------------------------- /Client/stylesheet/QApplyFriendInputInfoWnd.qss: -------------------------------------------------------------------------------- 1 | #QApplyFriendInputInfoWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-radius: 4px; 4 | } 5 | 6 | QLabel { 7 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 8 | color: black; 9 | border: none; 10 | } 11 | 12 | QPushButton { 13 | color: black; 14 | border: 1px solid rgb(229, 229, 229); 15 | border-radius: 4px; 16 | border-bottom: 1px solid rgb(204, 204, 204); 17 | background-color: rgb(251, 251, 251); 18 | font-size: 15px; 19 | } 20 | 21 | QPushButton:hover { 22 | border: 1px solid rgb(229, 229, 229); 23 | border-bottom: 1px solid rgb(204, 204, 204); 24 | background-color: rgb(246, 246, 246); 25 | } 26 | 27 | QPushButton:pressed { 28 | border: 1px solid rgb(229, 229, 229); 29 | border-bottom: 1px solid rgb(229, 229, 229); 30 | background-color: rgb(245, 245, 245); 31 | } 32 | 33 | QTextEdit { 34 | background-color: rgb(251, 251, 251); 35 | border: 1px solid rgb(229, 229, 229); 36 | font-size: 14px; 37 | border-radius: 4px; 38 | border-bottom: 2px solid rgb(134, 134, 134); 39 | } 40 | 41 | QTextEdit:hover { 42 | background-color: rgb(246, 246, 246); 43 | } 44 | 45 | QTextEdit:focus { 46 | background-color: rgb(255, 255, 255); 47 | border-bottom: 2px solid rgb(0, 90, 158); 48 | } 49 | 50 | QScrollBar:vertical { 51 | width: 4px; 52 | background-color: transparent; 53 | } 54 | 55 | QScrollBar::handle:vertical { 56 | border-radius: 2px; 57 | width: 4px; 58 | background: rgba(0, 0, 0, 0.5); 59 | min-height: 25px; 60 | } 61 | 62 | QScrollBar::add-line:vertical, 63 | QScrollBar::sub-line:vertical { 64 | background-color: transparent; 65 | border: none; 66 | } 67 | 68 | QScrollBar::sub-page:vertical, 69 | QScrollBar::add-page:vertical { 70 | background-color: transparent; 71 | } -------------------------------------------------------------------------------- /Client/stylesheet/QApplyFriendNextWnd.qss: -------------------------------------------------------------------------------- 1 | #QApplyFriendNextWnd { 2 | background-color: rgb(238, 244, 249); 3 | border-radius: 4px; 4 | } 5 | 6 | QLabel { 7 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 8 | color: black; 9 | border: none; 10 | } 11 | 12 | QPushButton { 13 | color: black; 14 | border: 1px solid rgb(229, 229, 229); 15 | border-radius: 4px; 16 | border-bottom: 1px solid rgb(204, 204, 204); 17 | background-color: rgb(251, 251, 251); 18 | font-size: 15px; 19 | } 20 | 21 | QPushButton:hover { 22 | border: 1px solid rgb(229, 229, 229); 23 | border-bottom: 1px solid rgb(204, 204, 204); 24 | background-color: rgb(246, 246, 246); 25 | } 26 | 27 | QPushButton:pressed { 28 | border: 1px solid rgb(229, 229, 229); 29 | border-bottom: 1px solid rgb(229, 229, 229); 30 | background-color: rgb(245, 245, 245); 31 | } -------------------------------------------------------------------------------- /Client/stylesheet/QChatFileInnerWnd.qss: -------------------------------------------------------------------------------- 1 | #QChatFileInnerWnd { 2 | background-color: rgb(238, 244, 249); 3 | border: 2px solid rgba(130, 135, 144); 4 | border-radius: 5px; 5 | } 6 | 7 | QLabel { 8 | font: 8px 'Segoe UI', 'Microsoft YaHei'; 9 | color: black; 10 | border: none; 11 | } 12 | 13 | QPushButton { 14 | color: black; 15 | border: 1px solid rgb(229, 229, 229); 16 | border-radius: 4px; 17 | border-bottom: 1px solid rgb(204, 204, 204); 18 | background-color: rgb(251, 251, 251); 19 | font-size: 15px; 20 | } 21 | 22 | QPushButton:hover { 23 | border: 1px solid rgb(229, 229, 229); 24 | border-bottom: 1px solid rgb(204, 204, 204); 25 | background-color: rgb(246, 246, 246); 26 | } 27 | 28 | QPushButton:pressed { 29 | border: 1px solid rgb(229, 229, 229); 30 | border-bottom: 1px solid rgb(229, 229, 229); 31 | background-color: rgb(245, 245, 245); 32 | } -------------------------------------------------------------------------------- /Client/stylesheet/QCommContactInfo.qss: -------------------------------------------------------------------------------- 1 | #QCommContactInfo { 2 | background-color: rgb(243, 243, 243); 3 | border-top-right-radius: 4px; 4 | border-bottom-right-radius: 4px; 5 | } 6 | 7 | #contentWnd { 8 | background-color: rgb(243, 243, 243); 9 | /* border: 1px solid rgb(130, 135, 144); */ 10 | } 11 | 12 | QLabel { 13 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 14 | color: black; 15 | border: none; 16 | } 17 | 18 | QPushButton { 19 | color: black; 20 | border: 1px solid rgb(229, 229, 229); 21 | border-radius: 4px; 22 | border-bottom: 1px solid rgb(204, 204, 204); 23 | background-color: rgb(251, 251, 251); 24 | font-size: 15px; 25 | } 26 | 27 | QPushButton:hover { 28 | border: 1px solid rgb(229, 229, 229); 29 | border-bottom: 1px solid rgb(204, 204, 204); 30 | background-color: rgb(246, 246, 246); 31 | } 32 | 33 | QPushButton:pressed { 34 | border: 1px solid rgb(229, 229, 229); 35 | border-bottom: 1px solid rgb(229, 229, 229); 36 | background-color: rgb(245, 245, 245); 37 | } -------------------------------------------------------------------------------- /Client/stylesheet/QCommListWnd.qss: -------------------------------------------------------------------------------- 1 | #QCommListWnd { 2 | background: rgb(243, 243, 243); 3 | /*border-radius: 4px;*/ 4 | } 5 | 6 | 7 | /*QListWidget qss*/ 8 | 9 | QListWidget { 10 | background: rgb(243, 243, 243); 11 | outline: none; 12 | border: 1px solid transparent; 13 | border-radius: 0px; 14 | /* selection-background-color: pink; */ 15 | /* alternate-background-color: green; */ 16 | padding: 4px; 17 | } 18 | 19 | QListWidget::item { 20 | color: black; 21 | background: rgb(243, 243, 243); 22 | /* border: 1px solid blue; */ 23 | height: 35px; 24 | margin-top: 3px; 25 | border-radius: 4px; 26 | } 27 | 28 | QListWidget::item:hover { 29 | background-color: rgb(234, 234, 234); 30 | } 31 | 32 | QListWidget::item:selected { 33 | background-color: rgb(234, 234, 234); 34 | } 35 | 36 | QScrollBar:vertical { 37 | width: 4px; 38 | background-color: transparent; 39 | } 40 | 41 | QScrollBar::handle:vertical { 42 | border-radius: 2px; 43 | width: 4px; 44 | background: rgba(0, 0, 0, 0.5); 45 | min-height: 25px; 46 | } 47 | 48 | QScrollBar::add-line:vertical, 49 | QScrollBar::sub-line:vertical { 50 | background-color: transparent; 51 | border: none; 52 | } 53 | 54 | QScrollBar::sub-page:vertical, 55 | QScrollBar::add-page:vertical { 56 | background-color: transparent; 57 | } 58 | 59 | QLabel { 60 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 61 | color: black; 62 | border: none; 63 | } 64 | 65 | QPushButton { 66 | color: black; 67 | border: 1px solid rgb(229, 229, 229); 68 | border-radius: 4px; 69 | border-bottom: 1px solid rgb(204, 204, 204); 70 | background-color: rgb(251, 251, 251); 71 | font-size: 15px; 72 | } 73 | 74 | QPushButton:hover { 75 | border: 1px solid rgb(229, 229, 229); 76 | border-bottom: 1px solid rgb(204, 204, 204); 77 | background-color: rgb(246, 246, 246); 78 | } 79 | 80 | QPushButton:pressed { 81 | border: 1px solid rgb(229, 229, 229); 82 | border-bottom: 1px solid rgb(229, 229, 229); 83 | background-color: rgb(245, 245, 245); 84 | } 85 | 86 | #settingBtn, 87 | #closeBtn, 88 | #minBtn { 89 | background-color: transparent; 90 | border: 1px solid transparent; 91 | } 92 | 93 | 94 | /*lineedit qss*/ 95 | 96 | QLineEdit { 97 | border-radius: 4px; 98 | border: 1px solid rgb(229, 229, 229); 99 | border-bottom: 1px solid rgb(134, 134, 134); 100 | background-color: rgb(251, 251, 251); 101 | } 102 | 103 | QLineEdit:hover { 104 | background-color: rgb(246, 246, 246); 105 | } 106 | 107 | QLineEdit:focus { 108 | border-bottom: 2px solid rgb(0, 90, 158); 109 | } -------------------------------------------------------------------------------- /Client/stylesheet/QDealNewFriendsApplyWnd.qss: -------------------------------------------------------------------------------- 1 | #QDealNewFriendsApplyWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-top-right-radius: 4px; 4 | border-bottom-right-radius: 4px; 5 | border: 0px; 6 | } 7 | 8 | QPushButton { 9 | color: black; 10 | border: 1px solid rgb(229, 229, 229); 11 | border-radius: 4px; 12 | border-bottom: 1px solid rgb(204, 204, 204); 13 | background-color: rgb(251, 251, 251); 14 | font-size: 15px; 15 | } 16 | 17 | QPushButton:hover { 18 | border: 1px solid rgb(229, 229, 229); 19 | border-bottom: 1px solid rgb(204, 204, 204); 20 | background-color: rgb(246, 246, 246); 21 | } 22 | 23 | QPushButton:pressed { 24 | border: 1px solid rgb(229, 229, 229); 25 | border-bottom: 1px solid rgb(229, 229, 229); 26 | background-color: rgb(245, 245, 245); 27 | } 28 | 29 | QLabel { 30 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 31 | color: black; 32 | border: none; 33 | } 34 | 35 | QListWidget { 36 | background: rgb(243, 243, 243); 37 | outline: none; 38 | border: 1px solid transparent; 39 | border-radius: 0px; 40 | /* selection-background-color: pink; */ 41 | /* alternate-background-color: green; */ 42 | padding: 4px; 43 | } 44 | 45 | QListWidget::item { 46 | color: black; 47 | background: rgb(243, 243, 243); 48 | /* border: 1px solid blue; */ 49 | height: 35px; 50 | margin-top: 3px; 51 | border-radius: 4px; 52 | } 53 | 54 | QListWidget::item:hover { 55 | background-color: rgb(234, 234, 234); 56 | } 57 | 58 | QListWidget::item:selected { 59 | background-color: rgb(234, 234, 234); 60 | } 61 | 62 | QScrollBar:vertical { 63 | width: 4px; 64 | background-color: transparent; 65 | } 66 | 67 | QScrollBar::handle:vertical { 68 | border-radius: 2px; 69 | width: 4px; 70 | background: rgba(0, 0, 0, 0.5); 71 | min-height: 25px; 72 | } 73 | 74 | QScrollBar::add-line:vertical, 75 | QScrollBar::sub-line:vertical { 76 | background-color: transparent; 77 | border: none; 78 | } 79 | 80 | QScrollBar::sub-page:vertical, 81 | QScrollBar::add-page:vertical { 82 | background-color: transparent; 83 | } -------------------------------------------------------------------------------- /Client/stylesheet/QFindFriendItemWnd.qss: -------------------------------------------------------------------------------- 1 | #QFindFriendItemWnd { 2 | background-color: rgb(238, 244, 249); 3 | border-radius: 4px; 4 | } 5 | 6 | #QFindFriendItemWnd:!active { 7 | background-color: rgb(243, 243, 243); 8 | } 9 | 10 | #QFindFriendItemWnd:active { 11 | background-color: rgb(238, 244, 249); 12 | } 13 | 14 | QLabel { 15 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 16 | color: black; 17 | border: none; 18 | } 19 | 20 | QPushButton { 21 | color: black; 22 | border: 1px solid rgb(229, 229, 229); 23 | border-radius: 4px; 24 | border-bottom: 1px solid rgb(204, 204, 204); 25 | background-color: rgb(251, 251, 251); 26 | font-size: 15px; 27 | } 28 | 29 | QPushButton:hover { 30 | border: 1px solid rgb(229, 229, 229); 31 | border-bottom: 1px solid rgb(204, 204, 204); 32 | background-color: rgb(246, 246, 246); 33 | } 34 | 35 | QPushButton:pressed { 36 | border: 1px solid rgb(229, 229, 229); 37 | border-bottom: 1px solid rgb(229, 229, 229); 38 | background-color: rgb(245, 245, 245); 39 | } -------------------------------------------------------------------------------- /Client/stylesheet/QMainWnd.qss: -------------------------------------------------------------------------------- 1 | #QMainWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-radius: 4px; 4 | border: 1px black solid; 5 | } 6 | 7 | QLabel { 8 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 9 | color: black; 10 | border: none; 11 | } 12 | 13 | QPushButton { 14 | color: black; 15 | border: 1px solid rgb(229, 229, 229); 16 | border-radius: 4px; 17 | border-bottom: 1px solid rgb(204, 204, 204); 18 | background-color: rgb(251, 251, 251); 19 | font-size: 15px; 20 | } 21 | 22 | QPushButton:hover { 23 | border: 1px solid rgb(229, 229, 229); 24 | border-bottom: 1px solid rgb(204, 204, 204); 25 | background-color: rgb(246, 246, 246); 26 | } 27 | 28 | QPushButton:pressed { 29 | border: 1px solid rgb(229, 229, 229); 30 | border-bottom: 1px solid rgb(229, 229, 229); 31 | background-color: rgb(245, 245, 245); 32 | } -------------------------------------------------------------------------------- /Client/stylesheet/QPictureToolWnd.qss: -------------------------------------------------------------------------------- 1 | #QPictureToolWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-radius: 4px; 4 | } 5 | 6 | QPushButton { 7 | color: black; 8 | border: 1px solid rgb(229, 229, 229); 9 | border-radius: 4px; 10 | border-bottom: 1px solid rgb(204, 204, 204); 11 | background-color: rgb(251, 251, 251); 12 | font-size: 15px; 13 | } 14 | 15 | QPushButton:hover { 16 | border: 1px solid rgb(229, 229, 229); 17 | border-bottom: 1px solid rgb(204, 204, 204); 18 | background-color: rgb(246, 246, 246); 19 | } 20 | 21 | QPushButton:pressed { 22 | border: 1px solid rgb(229, 229, 229); 23 | border-bottom: 1px solid rgb(229, 229, 229); 24 | background-color: rgb(245, 245, 245); 25 | } -------------------------------------------------------------------------------- /Client/stylesheet/QSelectAddGroupOrAddFriendWnd.qss: -------------------------------------------------------------------------------- 1 | #QSelectAddGroupOrAddFriendWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-radius: 4px; 4 | border: 1px solid rgb(130, 135, 144); 5 | min-height: 70px; 6 | } 7 | 8 | QPushButton { 9 | color: black; 10 | border: 1px solid transparent; 11 | border-radius: 4px; 12 | background-color: rgb(243, 243, 243); 13 | /* font-size: 15px; */ 14 | min-height: 30px; 15 | } 16 | 17 | QPushButton:hover { 18 | background-color: rgb(234, 234, 234); 19 | } 20 | 21 | QPushButton:pressed { 22 | background-color: rgb(234, 234, 234); 23 | } -------------------------------------------------------------------------------- /Client/stylesheet/QSessionWnd.qss: -------------------------------------------------------------------------------- 1 | #QSessionWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-top-right-radius: 4px; 4 | border-bottom-right-radius: 4px; 5 | } 6 | 7 | QLabel { 8 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 9 | color: black; 10 | border: none; 11 | } 12 | 13 | QPushButton { 14 | color: black; 15 | border: 1px solid rgb(229, 229, 229); 16 | border-radius: 4px; 17 | border-bottom: 1px solid rgb(204, 204, 204); 18 | background-color: rgb(251, 251, 251); 19 | font-size: 15px; 20 | } 21 | 22 | QPushButton:hover { 23 | border: 1px solid rgb(229, 229, 229); 24 | border-bottom: 1px solid rgb(204, 204, 204); 25 | background-color: rgb(246, 246, 246); 26 | } 27 | 28 | QPushButton:pressed { 29 | border: 1px solid rgb(229, 229, 229); 30 | border-bottom: 1px solid rgb(229, 229, 229); 31 | background-color: rgb(245, 245, 245); 32 | } 33 | 34 | QTextEdit { 35 | color: black; 36 | background-color: rgb(243, 243, 243); 37 | font: 13px 'Segoe UI', 'Microsoft YaHei'; 38 | border: 0px; 39 | } 40 | 41 | QListView { 42 | /*设置背景颜色*/ 43 | background: rgb(243, 243, 243); 44 | border: none; 45 | font: 13px 'Segoe UI', 'Microsoft YaHei'; 46 | } -------------------------------------------------------------------------------- /Client/stylesheet/QSettingWnd.qss: -------------------------------------------------------------------------------- 1 | #QSettingWnd { 2 | background-color: rgb(238, 244, 249); 3 | border-radius: 4px; 4 | border: 1px solid rgb(130, 145, 144); 5 | } 6 | 7 | QLabel { 8 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 9 | color: black; 10 | border: none; 11 | } 12 | 13 | QPushButton { 14 | color: black; 15 | border: 1px solid rgb(229, 229, 229); 16 | border-radius: 4px; 17 | border-bottom: 1px solid rgb(204, 204, 204); 18 | background-color: rgb(251, 251, 251); 19 | font-size: 15px; 20 | } 21 | 22 | QPushButton:hover { 23 | border: 1px solid rgb(229, 229, 229); 24 | border-bottom: 1px solid rgb(204, 204, 204); 25 | background-color: rgb(246, 246, 246); 26 | } 27 | 28 | QPushButton:pressed { 29 | border: 1px solid rgb(229, 229, 229); 30 | border-bottom: 1px solid rgb(229, 229, 229); 31 | background-color: rgb(245, 245, 245); 32 | } 33 | 34 | QComboBox { 35 | border: 1px solid rgb(238, 239, 238); 36 | border-radius: 5px; 37 | padding: 5px 12px 6px 12px; 38 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 39 | color: black; 40 | background-color: rgb(254, 254, 254); 41 | text-align: left; 42 | } 43 | 44 | QComboBox:hover { 45 | background-color: rgb(251, 251, 251); 46 | } 47 | 48 | QComboBox::drop-down { 49 | subcontrol-origin: padding; 50 | subcontrol-position: top right; 51 | width: 15px; 52 | border-left-width: 1px; 53 | border-left-style: solid; 54 | border-top-right-radius: 3px; 55 | border-bottom-right-radius: 3px; 56 | } 57 | 58 | 59 | /*设置选择的颜色*/ 60 | 61 | QComboBox QAbstractItemView { 62 | color: black; 63 | margin-top: 4px; 64 | padding-left: 10px; 65 | padding-right: 10px; 66 | border: none; 67 | } 68 | 69 | QComboBox QListView { 70 | border: 1px solid rgba(0, 0, 0, 0.1); 71 | outline: none; 72 | font: 14px 'Segoe UI', 'Microsoft YaHei'; 73 | } -------------------------------------------------------------------------------- /Client/stylesheet/QUserInfoWnd.qss: -------------------------------------------------------------------------------- 1 | #QUserInfoWnd { 2 | background-color: rgb(243, 243, 243); 3 | border-radius: 4px; 4 | border: 1px solid rgb(130, 135, 144); 5 | } 6 | 7 | QLabel { 8 | font: 12px 'Segoe UI', 'Microsoft YaHei'; 9 | color: black; 10 | border: none; 11 | } 12 | 13 | #usernameLabel, 14 | #userIdLabel { 15 | color: rgb(158, 158, 158); 16 | } 17 | 18 | QPushButton { 19 | color: black; 20 | border: 1px solid rgb(229, 229, 229); 21 | border-radius: 4px; 22 | border-bottom: 1px solid rgb(204, 204, 204); 23 | background-color: rgb(251, 251, 251); 24 | font-size: 15px; 25 | } 26 | 27 | QPushButton:hover { 28 | border: 1px solid rgb(229, 229, 229); 29 | border-bottom: 1px solid rgb(204, 204, 204); 30 | background-color: rgb(246, 246, 246); 31 | } 32 | 33 | QPushButton:pressed { 34 | border: 1px solid rgb(229, 229, 229); 35 | border-bottom: 1px solid rgb(229, 229, 229); 36 | background-color: rgb(245, 245, 245); 37 | } -------------------------------------------------------------------------------- /Client/stylesheet/wechat.dark.qss: -------------------------------------------------------------------------------- 1 | QScrollBar:vertical 2 | { 3 | width:4px; 4 | background:rgba(0,0,0,0%); 5 | margin:0px,0px,0px,0px; 6 | padding-top:9px; 7 | padding-bottom:9px; 8 | } 9 | 10 | QScrollBar::handle:vertical 11 | { 12 | width:4px; 13 | background:rgba(0,0,0,25%); 14 | border-radius:2px; 15 | max-height:20; 16 | } 17 | 18 | QScrollBar::handle:vertical:hover 19 | { 20 | width:4px; 21 | background:rgba(0,0,0,50%); 22 | border-radius:2px; 23 | max-height:20; 24 | } 25 | 26 | QScrollBar::add-line:vertical 27 | { 28 | height:9px; 29 | width:4px; 30 | subcontrol-position:bottom; 31 | } 32 | 33 | QScrollBar::sub-line:vertical 34 | { 35 | height:9px; 36 | width:4px; 37 | subcontrol-position:top; 38 | } 39 | 40 | QScrollBar::add-line:vertical:hover 41 | { 42 | height:9px; 43 | width:4px; 44 | subcontrol-position:bottom; 45 | } 46 | 47 | QScrollBar::sub-line:vertical:hover 48 | { 49 | height:9px; 50 | width:4px; 51 | subcontrol-position:top; 52 | } 53 | 54 | QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical 55 | { 56 | background:rgba(0,0,0,10%); 57 | border-radius:2px; 58 | } 59 | 60 | 61 | QScrollBar:horizontal 62 | { 63 | width:4px; 64 | background:rgba(0,0,0,0%); 65 | margin:0px,0px,0px,0px; 66 | padding-top:9px; 67 | padding-bottom:9px; 68 | } 69 | QScrollBar::handle:horizontal 70 | { 71 | width:4px; 72 | background:rgba(0,0,0,25%); 73 | border-radius:2px; 74 | min-height:20; 75 | } 76 | QScrollBar::handle:horizontal:hover 77 | { 78 | width:4px; 79 | background:rgba(0,0,0,50%); 80 | border-radius:2px; 81 | min-height:20; 82 | } 83 | QScrollBar::add-line:horizontal 84 | { 85 | height:9px; 86 | width:4px; 87 | subcontrol-position:bottom; 88 | } 89 | QScrollBar::sub-line:horizontal 90 | { 91 | height:9px; 92 | width:4px; 93 | subcontrol-position:top; 94 | } 95 | QScrollBar::add-line:horizontal:hover 96 | { 97 | height:9px; 98 | width:4px; 99 | subcontrol-position:bottom; 100 | } 101 | QScrollBar::sub-line:horizontal:hover 102 | { 103 | height:9px; 104 | width:4px; 105 | subcontrol-position:top; 106 | } 107 | QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal 108 | { 109 | background:rgba(0,0,0,10%); 110 | border-radius:2px; 111 | } -------------------------------------------------------------------------------- /Client/stylesheet/wechat.qss: -------------------------------------------------------------------------------- 1 | QScrollBar:vertical { 2 | background: transparent; 3 | width: 4px; 4 | margin-top: 12px; 5 | margin-bottom: 12px; 6 | padding-right: 2px; 7 | } 8 | 9 | QScrollBar:horizontal { 10 | background: transparent; 11 | height: 4px; 12 | margin-left: 12px; 13 | margin-right: 12px; 14 | padding-bottom: 2px; 15 | } 16 | 17 | QScrollBar::sub-line { 18 | background: transparent; 19 | } 20 | 21 | QScrollBar::add-line { 22 | background: transparent; 23 | } 24 | 25 | QScrollBar::handle { 26 | background: rgb(122, 122, 122); 27 | border: 2px solid rgb(128, 128, 128); 28 | border-radius: 1px; 29 | } 30 | 31 | QScrollBar::handle:vertical { 32 | min-height: 8px; 33 | } 34 | 35 | QScrollBar::handle:horizontal { 36 | min-width: 8px; 37 | } 38 | 39 | QScrollBar::add-page:vertical, 40 | QScrollBar::sub-page:vertical, 41 | QScrollBar::add-page:horizontal, 42 | QScrollBar::sub-page:horizontal { 43 | background: none; 44 | } 45 | 46 | 47 | /* 48 | QMessageBox { 49 | background-color: rgb(238, 244, 249); 50 | border-radius: 4px; 51 | }*/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2022 mowangshiying 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # .Vc++ Qt 版微信 2 | 3 | 注:文件使用相对路径格式一定要使用“/”,如果使用的是“\”则,在windows下路径没有问题,但是提交到gitee上图片路径就对不上了,所以还是要使用"/"作为路径的分割符号,这样才能通用 4 | 5 | ## !!! 注意 6 | 7 | 目前处于重构状态中,大概两个礼拜后稳定。2025/03/06 ~ 2025/03/20。更换服务器通讯架构及接口。 8 | 9 | ## 介绍 10 | 11 | Vs+qt 使用c++开发仿照微信的聊天。 12 | 13 | ## 软件架构 14 | 15 | 关于页面ui设计的总体思路,及各个模块设计之后再总结吧。 16 | 17 | ## 安装教程 18 | 19 | 无需安装,目前程序发行是采用解压的版本。 20 | 21 | ## 开发日志 22 | 23 | ### 效果预览 24 | 25 | ![image-20230408195109180](./docs/images/image-20230408195109180.png) 26 | 27 | ![image-20230408195139125](./docs/images/image-20230408195139125.png) 28 | 29 | ### 详细内容 30 | 31 | 参见[开发日志](./docs/history.md)。 32 | 33 | ### 代码统计 34 | 35 | 2023/04/10,工程有效代码量为5000多行,详细信息如下: 36 | 37 | ![image-20230410071533443](./docs/images/image-20230410071533443.png) 38 | 39 | ### 代码规范 40 | 41 | * 1.尽量不使用多级指针,如: 42 | 43 | ``` 44 | void *p = getP()->getP()->get(); 45 | ``` 46 | 47 | * 2.信号与槽函数前缀分别标识为signal与slot方便区分信号函数或者槽函数,如: 48 | 49 | ``` 50 | void signalFunc(); 51 | void slotFunc(); 52 | ``` 53 | 54 | * 3.函数采用驼峰命名格式,首字母为小写,类采用驼峰格式,首字母为大写 55 | 56 | * 4.缩减函数的圈复杂度,即函数嵌套深度。 -------------------------------------------------------------------------------- /Server/chatserver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/chatserver.exe -------------------------------------------------------------------------------- /Server/gateserver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/gateserver.exe -------------------------------------------------------------------------------- /Server/hv.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/hv.dll -------------------------------------------------------------------------------- /Server/json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/json.dll -------------------------------------------------------------------------------- /Server/linkserver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/linkserver.exe -------------------------------------------------------------------------------- /Server/loginserver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/loginserver.exe -------------------------------------------------------------------------------- /Server/msvcp140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/msvcp140.dll -------------------------------------------------------------------------------- /Server/sqlite.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/sqlite.dll -------------------------------------------------------------------------------- /Server/vcruntime140.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/vcruntime140.dll -------------------------------------------------------------------------------- /Server/vcruntime140_1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/Server/vcruntime140_1.dll -------------------------------------------------------------------------------- /WeChat.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.9.34728.123 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Client", "Client\Client.vcxproj", "{EFD21C0C-725B-44B2-A892-039151F20F08}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Debug|x64.ActiveCfg = Debug|x64 17 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Debug|x64.Build.0 = Debug|x64 18 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Debug|x86.ActiveCfg = Debug|Win32 19 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Debug|x86.Build.0 = Debug|Win32 20 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Release|x64.ActiveCfg = Release|x64 21 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Release|x64.Build.0 = Release|x64 22 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Release|x86.ActiveCfg = Release|Win32 23 | {EFD21C0C-725B-44B2-A892-039151F20F08}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {5884C151-340A-4377-8F62-51497E45A0B8} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /docs/design/搜索框-参考.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/design/搜索框-参考.jpg -------------------------------------------------------------------------------- /docs/design/搜索框-参考.md: -------------------------------------------------------------------------------- 1 | # 搜索框分析与设计 2 | 3 | 参考图片: 4 | 5 | ![搜索框-参考](../images/搜索框-参考.jpg) 6 | 7 | 界面上的搜索框搜索结果分为三个部分,包括:联系人、群聊、聊天记录 8 | 9 | ## 联系人 10 | 11 | 包括联系人标签及联系人的子项,联系人标签:![image-20230527094724366](../images/image-20230527094724366.png),联系人子项目:![image-20230527094758544](../images/image-20230527094758544.png),包括左侧头像及右侧文字说明。点击子项目后,转到和此联系人相关的“会话”的窗口。 12 | 13 | ## 群聊 14 | 15 | 包括群聊标签及群聊子项,群聊标签:![image-20230527095046664](../images/image-20230527095046664.png),群聊子项:![image-20230527095124569](../images/image-20230527095124569.png),包括左侧头像及右侧文字说明。点击子项目后,转到和此群聊相关的“会话”的窗口。 16 | 17 | ## 聊天记录 18 | 19 | 包括聊天记录标签及消息子项,聊天记录标签:![image-20230527095429411](../images/image-20230527095429411.png),聊天记录子项:![image-20230527095556641](../images/image-20230527095556641.png),点击成功后,按照“会话”显示其中具体详细信息。 20 | 21 | -------------------------------------------------------------------------------- /docs/design/界面设计-参考.md: -------------------------------------------------------------------------------- 1 | # 界面设计参考 2 | 3 | >尽量将窗口整合到主界面中,不要弹窗。 -------------------------------------------------------------------------------- /docs/images/image-20220105002713210.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220105002713210.png -------------------------------------------------------------------------------- /docs/images/image-20220105235017541.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220105235017541.png -------------------------------------------------------------------------------- /docs/images/image-20220105235424102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220105235424102.png -------------------------------------------------------------------------------- /docs/images/image-20220106000145442.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220106000145442.png -------------------------------------------------------------------------------- /docs/images/image-20220106000351862.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220106000351862.png -------------------------------------------------------------------------------- /docs/images/image-20220106001015470.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220106001015470.png -------------------------------------------------------------------------------- /docs/images/image-20220106001732763.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220106001732763.png -------------------------------------------------------------------------------- /docs/images/image-20220106001929875.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220106001929875.png -------------------------------------------------------------------------------- /docs/images/image-20220106002018904.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220106002018904.png -------------------------------------------------------------------------------- /docs/images/image-20220119075236063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220119075236063.png -------------------------------------------------------------------------------- /docs/images/image-20220119075457716.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220119075457716.png -------------------------------------------------------------------------------- /docs/images/image-20220119075644684.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220119075644684.png -------------------------------------------------------------------------------- /docs/images/image-20220123171100114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220123171100114.png -------------------------------------------------------------------------------- /docs/images/image-20220123171339005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220123171339005.png -------------------------------------------------------------------------------- /docs/images/image-20220206232328636.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220206232328636.png -------------------------------------------------------------------------------- /docs/images/image-20220206233144664.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220206233144664.png -------------------------------------------------------------------------------- /docs/images/image-20220207225731078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207225731078.png -------------------------------------------------------------------------------- /docs/images/image-20220207225803867.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207225803867.png -------------------------------------------------------------------------------- /docs/images/image-20220207225827424.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207225827424.png -------------------------------------------------------------------------------- /docs/images/image-20220207225853265.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207225853265.png -------------------------------------------------------------------------------- /docs/images/image-20220207225906500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207225906500.png -------------------------------------------------------------------------------- /docs/images/image-20220207225941045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207225941045.png -------------------------------------------------------------------------------- /docs/images/image-20220207230624278.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207230624278.png -------------------------------------------------------------------------------- /docs/images/image-20220207230717863.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207230717863.png -------------------------------------------------------------------------------- /docs/images/image-20220207231034344.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207231034344.png -------------------------------------------------------------------------------- /docs/images/image-20220207231159494.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220207231159494.png -------------------------------------------------------------------------------- /docs/images/image-20220404113154149.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220404113154149.png -------------------------------------------------------------------------------- /docs/images/image-20220404114218516.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220404114218516.png -------------------------------------------------------------------------------- /docs/images/image-20220404114442147.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220404114442147.png -------------------------------------------------------------------------------- /docs/images/image-20220406081347618.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220406081347618.png -------------------------------------------------------------------------------- /docs/images/image-20220414224309021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220414224309021.png -------------------------------------------------------------------------------- /docs/images/image-20220414224447808.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220414224447808.png -------------------------------------------------------------------------------- /docs/images/image-20220416090429678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220416090429678.png -------------------------------------------------------------------------------- /docs/images/image-20220417165056586.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220417165056586.png -------------------------------------------------------------------------------- /docs/images/image-20220418085606040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220418085606040.png -------------------------------------------------------------------------------- /docs/images/image-20220430114558087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220430114558087.png -------------------------------------------------------------------------------- /docs/images/image-20220430115309411.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220430115309411.png -------------------------------------------------------------------------------- /docs/images/image-20220430115403394.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220430115403394.png -------------------------------------------------------------------------------- /docs/images/image-20220730230819181.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20220730230819181.png -------------------------------------------------------------------------------- /docs/images/image-20230408101649768.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230408101649768.png -------------------------------------------------------------------------------- /docs/images/image-20230408195022397.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230408195022397.png -------------------------------------------------------------------------------- /docs/images/image-20230408195109180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230408195109180.png -------------------------------------------------------------------------------- /docs/images/image-20230408195139125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230408195139125.png -------------------------------------------------------------------------------- /docs/images/image-20230410071533443.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230410071533443.png -------------------------------------------------------------------------------- /docs/images/image-20230424002228889.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230424002228889.png -------------------------------------------------------------------------------- /docs/images/image-20230527094724366.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527094724366.png -------------------------------------------------------------------------------- /docs/images/image-20230527094758544.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527094758544.png -------------------------------------------------------------------------------- /docs/images/image-20230527095046664.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527095046664.png -------------------------------------------------------------------------------- /docs/images/image-20230527095124569.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527095124569.png -------------------------------------------------------------------------------- /docs/images/image-20230527095429411.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527095429411.png -------------------------------------------------------------------------------- /docs/images/image-20230527095556641.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527095556641.png -------------------------------------------------------------------------------- /docs/images/image-20230527230714493.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230527230714493.png -------------------------------------------------------------------------------- /docs/images/image-20230530224502776.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230530224502776.png -------------------------------------------------------------------------------- /docs/images/image-20230530224546216.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230530224546216.png -------------------------------------------------------------------------------- /docs/images/image-20230530224817440.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230530224817440.png -------------------------------------------------------------------------------- /docs/images/image-20230530224919259.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/image-20230530224919259.png -------------------------------------------------------------------------------- /docs/images/sesmsg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/sesmsg.png -------------------------------------------------------------------------------- /docs/images/搜索框-参考.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/搜索框-参考.jpg -------------------------------------------------------------------------------- /docs/images/消息框的设计.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mowangshuying/WeChat/36e15315437ff89440cfda9f6c60601539caea62/docs/images/消息框的设计.bmp -------------------------------------------------------------------------------- /docs/plan/plan-2023-4.md: -------------------------------------------------------------------------------- 1 | ## 2023/4月份计划 2 | 3 | 1、功能特性进入冻结阶段,暂不开发新的功能。 4 | 5 | 2、界面优化,bug修复。 6 | 7 | * 语音通话聊天页面优化,语音通话聊天页面合理关闭及打开 8 | * 调整窗口大小时候,有些时候不生效,变成了拖动 9 | * 调整鼠标显示,鼠标在界面边缘地方显示的形状有点不符和,如在最大化按钮上,显示一个上下箭头(用于改变窗口的鼠标形状) -------------------------------------------------------------------------------- /docs/plan/plan-2023-5.md: -------------------------------------------------------------------------------- 1 | ## 2023/5月份计划 2 | 3 | 1.在搜索框中添加一个搜索按钮: 4 | 5 | ![image-20230530224502776](../images/image-20230530224502776.png) ==> ![image-20230530224546216](../images/image-20230530224546216.png) 6 | 7 | 2.群信息窗口优化 8 | 9 | ![image-20230530224817440](../images/image-20230530224817440.png) ==>![image-20230530224919259](../images/image-20230530224919259.png) 10 | 11 | -------------------------------------------------------------------------------- /format.bat: -------------------------------------------------------------------------------- 1 | start "" "C:\Program Files\Git\git-bash.exe" -c "./format.sh;bash" 2 | -------------------------------------------------------------------------------- /format.sh: -------------------------------------------------------------------------------- 1 | clang-format --version 2 | find Client -name *.h -o -name *.cpp -exec unix2dos {} \; 3 | find Client -name *.h -o -name *.cpp|xargs clang-format -i -style=file --------------------------------------------------------------------------------