mirror of
https://github.com/JasonYANG170/AIChatForPC.git
synced 2024-10-19 13:32:05 +00:00
add qt
This commit is contained in:
parent
d0e3909a3e
commit
ddc6dc8404
68
README.md
68
README.md
|
@ -1,34 +1,34 @@
|
||||||
# YANG Chat
|
# YANG Chat
|
||||||
**记得给我的项目点个⭐️Starred哦,让我更有动力维护它**
|
**记得给我的项目点个⭐️Starred哦,让我更有动力维护它**
|
||||||
|
|
||||||
**QQ群:568338055获取最新密钥**
|
**QQ群:568338055获取最新密钥**
|
||||||
|
|
||||||
本项目于2023年3月4日启动,并发布第一个测试版本。
|
本项目于2023年3月4日启动,并发布第一个测试版本。
|
||||||
|
|
||||||
这是一项AI聊天程序,本程序现已接入OpenAI ChatGPT API,
|
这是一项AI聊天程序,本程序现已接入OpenAI ChatGPT API,
|
||||||
|
|
||||||
您可以通过本程序帮助您写代码,写文章,以及提问。
|
您可以通过本程序帮助您写代码,写文章,以及提问。
|
||||||
|
|
||||||
严禁将本项目涉及违法违规以及政治领域,程序将秉持公平公正客观的原则回答您所提出的问题。
|
严禁将本项目涉及违法违规以及政治领域,程序将秉持公平公正客观的原则回答您所提出的问题。
|
||||||
|
|
||||||
后期我们将为程序推出更多功能,敬请期待。
|
后期我们将为程序推出更多功能,敬请期待。
|
||||||
|
|
||||||
**本项目已经转入QT开发,发布V6.0正式版本**
|
**本项目已经转入QT开发,发布V6.0正式版本**
|
||||||
|
|
||||||
**安卓版本开发完成,欢迎下载测试**
|
**安卓版本开发完成,欢迎下载测试**
|
||||||
|
|
||||||
https://github.com/JasonYANG170/YANG-Chat-Android
|
https://github.com/JasonYANG170/YANG-Chat-Android
|
||||||
# 使用方法
|
# 使用方法
|
||||||
1.在release区下载msi文件并安装。
|
1.在release区下载msi文件并安装。
|
||||||
|
|
||||||
2.输入开放测试密钥73838(不定期更新,加群获取最新密钥)。
|
2.输入开放测试密钥73838(不定期更新,加群获取最新密钥)。
|
||||||
|
|
||||||
3.在输入框输入您的问题。
|
3.在输入框输入您的问题。
|
||||||
# 程序截图
|
# 程序截图
|
||||||
**V1.0.0**
|
**V1.0.0**
|
||||||
|
|
||||||
![屏幕截图(805)](https://user-images.githubusercontent.com/39414350/222898309-9541e3be-34a5-4def-a66e-3974b6e8c329.png)
|
![屏幕截图(805)](https://user-images.githubusercontent.com/39414350/222898309-9541e3be-34a5-4def-a66e-3974b6e8c329.png)
|
||||||
|
|
||||||
**V5.1.0**
|
**V5.1.0**
|
||||||
|
|
||||||
![屏幕截图(576)](https://user-images.githubusercontent.com/39414350/236625151-90034fe9-a4ff-4060-93cb-d4d2cf95bf50.png)
|
![屏幕截图(576)](https://user-images.githubusercontent.com/39414350/236625151-90034fe9-a4ff-4060-93cb-d4d2cf95bf50.png)
|
||||||
|
|
|
@ -1,31 +1,31 @@
|
||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.4.33403.182
|
VisualStudioVersion = 17.4.33403.182
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YANG Chat", "YANG Chat\YANG Chat.vcxproj", "{105FD556-55C2-460A-B7CA-F0E2F437A770}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YANG Chat", "YANG Chat\YANG Chat.vcxproj", "{105FD556-55C2-460A-B7CA-F0E2F437A770}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|x64 = Debug|x64
|
Debug|x64 = Debug|x64
|
||||||
Debug|x86 = Debug|x86
|
Debug|x86 = Debug|x86
|
||||||
Release|x64 = Release|x64
|
Release|x64 = Release|x64
|
||||||
Release|x86 = Release|x86
|
Release|x86 = Release|x86
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x64.ActiveCfg = Debug|x64
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x64.Build.0 = Debug|x64
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x64.Build.0 = Debug|x64
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x86.ActiveCfg = Debug|Win32
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x86.Build.0 = Debug|Win32
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Debug|x86.Build.0 = Debug|Win32
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x64.ActiveCfg = Release|x64
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x64.ActiveCfg = Release|x64
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x64.Build.0 = Release|x64
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x64.Build.0 = Release|x64
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x86.ActiveCfg = Release|Win32
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x86.ActiveCfg = Release|Win32
|
||||||
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x86.Build.0 = Release|Win32
|
{105FD556-55C2-460A-B7CA-F0E2F437A770}.Release|x86.Build.0 = Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {9EEA59B3-CEBC-4A50-BA95-E7C0E4CFBFF8}
|
SolutionGuid = {9EEA59B3-CEBC-4A50-BA95-E7C0E4CFBFF8}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
269
YANG-Chat.pro.user
Normal file
269
YANG-Chat.pro.user
Normal file
|
@ -0,0 +1,269 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE QtCreatorProject>
|
||||||
|
<!-- Written by QtCreator 13.0.0, 2024-04-18T01:35:15. -->
|
||||||
|
<qtcreator>
|
||||||
|
<data>
|
||||||
|
<variable>EnvironmentId</variable>
|
||||||
|
<value type="QByteArray">{5913d737-a7b3-40d5-81b3-ef43144c2778}</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
<value type="qlonglong">0</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||||
|
<value type="QString" key="language">Cpp</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||||
|
<value type="QString" key="language">QmlJS</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||||
|
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||||
|
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||||
|
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||||
|
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||||
|
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||||
|
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="ClangTools">
|
||||||
|
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||||
|
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||||
|
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||||
|
<value type="int" key="ClangTools.ParallelJobs">8</value>
|
||||||
|
<value type="bool" key="ClangTools.PreferConfigFile">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||||
|
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="QString" key="DeviceType">Desktop</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.8.0 MinGW 64-bit</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.8.0 MinGW 64-bit</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.dev.win64_mingw_kit</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
|
<value type="int" key="EnableQmlDebugging">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\qw200\Documents\C or C++ for YANG\build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Debug</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Debug</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\qw200\Documents\C or C++ for YANG\build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Release</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Release</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
|
<value type="int" key="QtQuickCompiler">0</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||||
|
<value type="int" key="EnableQmlDebugging">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\qw200\Documents\C or C++ for YANG\build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Profile</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Profile</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
|
<value type="int" key="QtQuickCompiler">0</value>
|
||||||
|
<value type="int" key="SeparateDebugInfo">0</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||||
|
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="QList<int>" key="Analyzer.Valgrind.VisibleErrorKinds"></value>
|
||||||
|
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||||
|
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||||
|
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||||
|
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||||
|
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph "dwarf,4096" -F 250</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">YANG-Chat2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/C++-QT/YANG-Chat/YANG-Chat.pro</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">E:/C++-QT/YANG-Chat/YANG-Chat.pro</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
|
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Release</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||||
|
<value type="qlonglong">1</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||||
|
<value type="int">22</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>Version</variable>
|
||||||
|
<value type="int">22</value>
|
||||||
|
</data>
|
||||||
|
</qtcreator>
|
108
YANG-ChatForMFC/YANG Chat.cpp
Normal file
108
YANG-ChatForMFC/YANG Chat.cpp
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
|
||||||
|
// YANG Chat.cpp: 定义应用程序的类行为。
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "framework.h"
|
||||||
|
#include "YANG Chat.h"
|
||||||
|
#include "YANG ChatDlg.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatApp
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CYANGChatApp, CWinApp)
|
||||||
|
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatApp 构造
|
||||||
|
|
||||||
|
CYANGChatApp::CYANGChatApp()
|
||||||
|
{
|
||||||
|
// 支持重新启动管理器
|
||||||
|
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
|
||||||
|
|
||||||
|
// TODO: 在此处添加构造代码,
|
||||||
|
// 将所有重要的初始化放置在 InitInstance 中
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 唯一的 CYANGChatApp 对象
|
||||||
|
|
||||||
|
CYANGChatApp theApp;
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatApp 初始化
|
||||||
|
|
||||||
|
BOOL CYANGChatApp::InitInstance()
|
||||||
|
{
|
||||||
|
AfxInitRichEdit2();
|
||||||
|
// 如果一个运行在 Windows XP 上的应用程序清单指定要
|
||||||
|
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
|
||||||
|
//则需要 InitCommonControlsEx()。 否则,将无法创建窗口。
|
||||||
|
INITCOMMONCONTROLSEX InitCtrls;
|
||||||
|
InitCtrls.dwSize = sizeof(InitCtrls);
|
||||||
|
// 将它设置为包括所有要在应用程序中使用的
|
||||||
|
// 公共控件类。
|
||||||
|
InitCtrls.dwICC = ICC_WIN95_CLASSES;
|
||||||
|
InitCommonControlsEx(&InitCtrls);
|
||||||
|
|
||||||
|
CWinApp::InitInstance();
|
||||||
|
|
||||||
|
|
||||||
|
AfxEnableControlContainer();
|
||||||
|
|
||||||
|
// 创建 shell 管理器,以防对话框包含
|
||||||
|
// 任何 shell 树视图控件或 shell 列表视图控件。
|
||||||
|
CShellManager *pShellManager = new CShellManager;
|
||||||
|
|
||||||
|
// 激活“Windows Native”视觉管理器,以便在 MFC 控件中启用主题
|
||||||
|
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
|
||||||
|
|
||||||
|
// 标准初始化
|
||||||
|
// 如果未使用这些功能并希望减小
|
||||||
|
// 最终可执行文件的大小,则应移除下列
|
||||||
|
// 不需要的特定初始化例程
|
||||||
|
// 更改用于存储设置的注册表项
|
||||||
|
// TODO: 应适当修改该字符串,
|
||||||
|
// 例如修改为公司或组织名
|
||||||
|
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
|
||||||
|
|
||||||
|
CYANGChatDlg dlg;
|
||||||
|
m_pMainWnd = &dlg;
|
||||||
|
INT_PTR nResponse = dlg.DoModal();
|
||||||
|
if (nResponse == IDOK)
|
||||||
|
{
|
||||||
|
// TODO: 在此放置处理何时用
|
||||||
|
// “确定”来关闭对话框的代码
|
||||||
|
}
|
||||||
|
else if (nResponse == IDCANCEL)
|
||||||
|
{
|
||||||
|
// TODO: 在此放置处理何时用
|
||||||
|
// “取消”来关闭对话框的代码
|
||||||
|
}
|
||||||
|
else if (nResponse == -1)
|
||||||
|
{
|
||||||
|
TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
|
||||||
|
TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除上面创建的 shell 管理器。
|
||||||
|
if (pShellManager != nullptr)
|
||||||
|
{
|
||||||
|
delete pShellManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !defined(_AFXDLL) && !defined(_AFX_NO_MFC_CONTROLS_IN_DIALOGS)
|
||||||
|
ControlBarCleanUp();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
|
||||||
|
// 而不是启动应用程序的消息泵。
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
32
YANG-ChatForMFC/YANG Chat.h
Normal file
32
YANG-ChatForMFC/YANG Chat.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
// YANG Chat.h: PROJECT_NAME 应用程序的主头文件
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef __AFXWIN_H__
|
||||||
|
#error "在包含此文件之前包含 'pch.h' 以生成 PCH"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "resource.h" // 主符号
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatApp:
|
||||||
|
// 有关此类的实现,请参阅 YANG Chat.cpp
|
||||||
|
//
|
||||||
|
|
||||||
|
class CYANGChatApp : public CWinApp
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CYANGChatApp();
|
||||||
|
|
||||||
|
// 重写
|
||||||
|
public:
|
||||||
|
virtual BOOL InitInstance();
|
||||||
|
|
||||||
|
// 实现
|
||||||
|
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
extern CYANGChatApp theApp;
|
220
YANG-ChatForMFC/YANG Chat.vcxproj
Normal file
220
YANG-ChatForMFC/YANG Chat.vcxproj
Normal file
|
@ -0,0 +1,220 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>17.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{105FD556-55C2-460A-B7CA-F0E2F437A770}</ProjectGuid>
|
||||||
|
<Keyword>MFCProj</Keyword>
|
||||||
|
<RootNamespace>YANGChat</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
<UseOfMfc>Dynamic</UseOfMfc>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<IncludePath>C:\Users\qw200\Documents\json\include;$(IncludePath)</IncludePath>
|
||||||
|
<LibraryPath>C:\Users\qw200\Documents\json\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
</Link>
|
||||||
|
<Midl>
|
||||||
|
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||||
|
<ValidateAllParameters>true</ValidateAllParameters>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0804</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
</Link>
|
||||||
|
<Midl>
|
||||||
|
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||||
|
<ValidateAllParameters>true</ValidateAllParameters>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0804</Culture>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
<Midl>
|
||||||
|
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||||
|
<ValidateAllParameters>true</ValidateAllParameters>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0804</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<AdditionalDependencies>jsoncpp.lib</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<Midl>
|
||||||
|
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||||
|
<ValidateAllParameters>true</ValidateAllParameters>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
</Midl>
|
||||||
|
<ResourceCompile>
|
||||||
|
<Culture>0x0804</Culture>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="framework.h" />
|
||||||
|
<ClInclude Include="pch.h" />
|
||||||
|
<ClInclude Include="Resource.h" />
|
||||||
|
<ClInclude Include="targetver.h" />
|
||||||
|
<ClInclude Include="YANG Chat.h" />
|
||||||
|
<ClInclude Include="YANG ChatDlg.h" />
|
||||||
|
<ClInclude Include="yangchatmain.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="pch.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="YANG Chat.cpp" />
|
||||||
|
<ClCompile Include="YANG ChatDlg.cpp" />
|
||||||
|
<ClCompile Include="yangchatmain.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="YANGChat.rc" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="res\YANGChat.rc2" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="res\YANG Chat.ico" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
69
YANG-ChatForMFC/YANG Chat.vcxproj.filters
Normal file
69
YANG-ChatForMFC/YANG Chat.vcxproj.filters
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="源文件">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="头文件">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="资源文件">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="YANG Chat.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="YANG ChatDlg.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="framework.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="targetver.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Resource.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="pch.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="yangchatmain.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="YANG Chat.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="YANG ChatDlg.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="pch.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="yangchatmain.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="YANGChat.rc">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="res\YANGChat.rc2">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="res\YANG Chat.ico">
|
||||||
|
<Filter>资源文件</Filter>
|
||||||
|
</Image>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
314
YANG-ChatForMFC/YANG ChatDlg.cpp
Normal file
314
YANG-ChatForMFC/YANG ChatDlg.cpp
Normal file
|
@ -0,0 +1,314 @@
|
||||||
|
|
||||||
|
// YANG ChatDlg.cpp: 实现文件
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "framework.h"
|
||||||
|
#include "YANG Chat.h"
|
||||||
|
#include "YANG ChatDlg.h"
|
||||||
|
#include "afxdialogex.h"
|
||||||
|
#include "yangchatmain.h"
|
||||||
|
#include "afxdialogex.h"
|
||||||
|
#include <json/json.h>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#define new DEBUG_NEW
|
||||||
|
#endif
|
||||||
|
CString edition = _T("V1.0.0");
|
||||||
|
|
||||||
|
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
|
||||||
|
// pass1 消息处理程序
|
||||||
|
#include <afxinet.h>
|
||||||
|
CString CYANGChatDlg::UTF8ToUnicode2(char* UTF8)
|
||||||
|
{
|
||||||
|
|
||||||
|
DWORD dwUnicodeLen; //转换后Unicode的长度
|
||||||
|
TCHAR* pwText; //保存Unicode的指针
|
||||||
|
CString strUnicode; //返回值
|
||||||
|
//获得转换后的长度,并分配内存
|
||||||
|
dwUnicodeLen = MultiByteToWideChar(CP_UTF8, 0, UTF8, -1, NULL, 0);
|
||||||
|
pwText = new TCHAR[dwUnicodeLen];
|
||||||
|
if (!pwText)
|
||||||
|
{
|
||||||
|
return strUnicode;
|
||||||
|
}
|
||||||
|
//转为Unicode
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, UTF8, -1, pwText, dwUnicodeLen);
|
||||||
|
//转为CString
|
||||||
|
strUnicode.Format(_T("%s"), pwText);
|
||||||
|
//清除内存
|
||||||
|
delete[]pwText;
|
||||||
|
//返回转换好的Unicode字串
|
||||||
|
return strUnicode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class CAboutDlg : public CDialogEx
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CAboutDlg();
|
||||||
|
|
||||||
|
// 对话框数据
|
||||||
|
#ifdef AFX_DESIGN_TIME
|
||||||
|
enum { IDD = IDD_ABOUTBOX };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||||
|
|
||||||
|
// 实现
|
||||||
|
protected:
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
};
|
||||||
|
|
||||||
|
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialogEx::DoDataExchange(pDX);
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatDlg 对话框
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CYANGChatDlg::CYANGChatDlg(CWnd* pParent /*=nullptr*/)
|
||||||
|
: CDialogEx(IDD_YANG_CHAT_DIALOG, pParent)
|
||||||
|
{
|
||||||
|
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CYANGChatDlg::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialogEx::DoDataExchange(pDX);
|
||||||
|
}
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(CYANGChatDlg, CDialogEx)
|
||||||
|
ON_WM_SYSCOMMAND()
|
||||||
|
ON_WM_PAINT()
|
||||||
|
ON_WM_QUERYDRAGICON()
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON1, &CYANGChatDlg::OnBnClickedButton1)
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatDlg 消息处理程序
|
||||||
|
|
||||||
|
BOOL CYANGChatDlg::OnInitDialog()
|
||||||
|
{
|
||||||
|
CDialogEx::OnInitDialog();
|
||||||
|
|
||||||
|
// 将“关于...”菜单项添加到系统菜单中。
|
||||||
|
|
||||||
|
// IDM_ABOUTBOX 必须在系统命令范围内。
|
||||||
|
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||||
|
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||||
|
|
||||||
|
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||||
|
if (pSysMenu != nullptr)
|
||||||
|
{
|
||||||
|
BOOL bNameValid;
|
||||||
|
CString strAboutMenu;
|
||||||
|
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||||
|
ASSERT(bNameValid);
|
||||||
|
if (!strAboutMenu.IsEmpty())
|
||||||
|
{
|
||||||
|
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||||
|
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置此对话框的图标。 当应用程序主窗口不是对话框时,框架将自动
|
||||||
|
// 执行此操作
|
||||||
|
SetIcon(m_hIcon, TRUE); // 设置大图标
|
||||||
|
SetIcon(m_hIcon, FALSE); // 设置小图标
|
||||||
|
|
||||||
|
// TODO: 在此添加额外的初始化代码
|
||||||
|
|
||||||
|
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
|
||||||
|
}
|
||||||
|
|
||||||
|
void CYANGChatDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||||
|
{
|
||||||
|
CAboutDlg dlgAbout;
|
||||||
|
dlgAbout.DoModal();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CDialogEx::OnSysCommand(nID, lParam);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果向对话框添加最小化按钮,则需要下面的代码
|
||||||
|
// 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序,
|
||||||
|
// 这将由框架自动完成。
|
||||||
|
|
||||||
|
void CYANGChatDlg::OnPaint()
|
||||||
|
{
|
||||||
|
if (IsIconic())
|
||||||
|
{
|
||||||
|
CPaintDC dc(this); // 用于绘制的设备上下文
|
||||||
|
|
||||||
|
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
|
||||||
|
|
||||||
|
// 使图标在工作区矩形中居中
|
||||||
|
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||||
|
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||||
|
CRect rect;
|
||||||
|
GetClientRect(&rect);
|
||||||
|
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||||
|
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||||
|
|
||||||
|
// 绘制图标
|
||||||
|
dc.DrawIcon(x, y, m_hIcon);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CDialogEx::OnPaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
CInternetSession session(_T("HttpClient"));
|
||||||
|
TCHAR* url = _T("https://api.vvhan.com/api/qqsc?key=8f2807e6a7ebfbc168f4a1ecad286283");
|
||||||
|
CHttpFile* pfile = (CHttpFile*)session.OpenURL(url);
|
||||||
|
DWORD dwStatusCode;
|
||||||
|
pfile->QueryInfoStatusCode(dwStatusCode);
|
||||||
|
if (dwStatusCode == HTTP_STATUS_OK)
|
||||||
|
{
|
||||||
|
CString content;
|
||||||
|
CString data;
|
||||||
|
while (pfile->ReadString(data))
|
||||||
|
{
|
||||||
|
content += data;
|
||||||
|
}
|
||||||
|
char* pch;
|
||||||
|
pch = new char[content.GetLength() * sizeof(TCHAR) + 1];
|
||||||
|
memcpy(pch, content, content.GetLength() * sizeof(TCHAR));
|
||||||
|
content = UTF8ToUnicode2(pch);//转换编码,不然就乱码了
|
||||||
|
//AfxMessageBox(content);
|
||||||
|
//CString content2;
|
||||||
|
// content2 = content.Left(content.Find('r'));
|
||||||
|
// content2 = content2.Right(content.GetLength() - 1 - content.ReverseFind(':'));
|
||||||
|
//CString contenta;
|
||||||
|
// contenta = content.Left(content.Find('a'));
|
||||||
|
//contenta = content.Right(content.GetLength() - 1 - content.ReverseFind(':'));
|
||||||
|
|
||||||
|
CString str = content;
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value root;
|
||||||
|
CString temp;
|
||||||
|
CString temp2;
|
||||||
|
CString temp3;
|
||||||
|
CString temp4;
|
||||||
|
CString temp5;
|
||||||
|
CString temp6;
|
||||||
|
USES_CONVERSION;
|
||||||
|
char* cJson = T2A(str.GetBuffer(0));
|
||||||
|
str.ReleaseBuffer();
|
||||||
|
if (reader.parse(cJson, root)) {
|
||||||
|
temp = root["text"].asCString();
|
||||||
|
//temp2 = root["data"][0]["desc"].asCString();
|
||||||
|
if (edition == temp) {
|
||||||
|
//MessageBox(temp);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CString tp = _T("已发布新版本\"");
|
||||||
|
CString tp2 = _T("\",为确保稳定性,请尽快更新!");
|
||||||
|
CString tp3 = tp + temp + tp2;
|
||||||
|
MessageBox(tp3);
|
||||||
|
}
|
||||||
|
//MessageBox(temp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
pfile->Close();
|
||||||
|
delete pfile;
|
||||||
|
session.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
//当用户拖动最小化窗口时系统调用此函数取得光标
|
||||||
|
//显示。
|
||||||
|
HCURSOR CYANGChatDlg::OnQueryDragIcon()
|
||||||
|
{
|
||||||
|
return static_cast<HCURSOR>(m_hIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CYANGChatDlg::OnBnClickedButton1()
|
||||||
|
{
|
||||||
|
// TODO: 在此添加控件通知处理程序代码
|
||||||
|
int num2;
|
||||||
|
// TODO: 在此添加控件通知处理程序代码
|
||||||
|
CInternetSession session(_T("HttpClient"));
|
||||||
|
TCHAR* url = _T("https://api.vvhan.com/api/qqsc?key=492fa5701060de4b2f30e08cbbe2defe");
|
||||||
|
CHttpFile* pfile = (CHttpFile*)session.OpenURL(url);
|
||||||
|
DWORD dwStatusCode;
|
||||||
|
pfile->QueryInfoStatusCode(dwStatusCode);
|
||||||
|
if (dwStatusCode == HTTP_STATUS_OK)
|
||||||
|
{
|
||||||
|
CString content;
|
||||||
|
CString data;
|
||||||
|
while (pfile->ReadString(data))
|
||||||
|
{
|
||||||
|
content += data;
|
||||||
|
}
|
||||||
|
char* pch;
|
||||||
|
pch = new char[content.GetLength() * sizeof(TCHAR) + 1];
|
||||||
|
memcpy(pch, content, content.GetLength() * sizeof(TCHAR));
|
||||||
|
content = UTF8ToUnicode2(pch);//转换编码,不然就乱码了
|
||||||
|
//AfxMessageBox(content);
|
||||||
|
//CString content2;
|
||||||
|
// content2 = content.Left(content.Find('r'));
|
||||||
|
// content2 = content2.Right(content.GetLength() - 1 - content.ReverseFind(':'));
|
||||||
|
//CString contenta;
|
||||||
|
// contenta = content.Left(content.Find('a'));
|
||||||
|
//contenta = content.Right(content.GetLength() - 1 - content.ReverseFind(':'));
|
||||||
|
|
||||||
|
CString str = content;
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value root;
|
||||||
|
CString temp;
|
||||||
|
CString temp2;
|
||||||
|
CString temp3;
|
||||||
|
CString temp4;
|
||||||
|
CString temp5;
|
||||||
|
CString temp6;
|
||||||
|
USES_CONVERSION;
|
||||||
|
char* cJson = T2A(str.GetBuffer(0));
|
||||||
|
str.ReleaseBuffer();
|
||||||
|
if (reader.parse(cJson, root)) {
|
||||||
|
temp = root["text"].asCString();
|
||||||
|
//temp2 = root["data"][0]["desc"].asCString();
|
||||||
|
// MessageBox(temp);
|
||||||
|
num2 = _ttoi(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
pfile->Close();
|
||||||
|
delete pfile;
|
||||||
|
session.Close();
|
||||||
|
|
||||||
|
CString passw1;
|
||||||
|
GetDlgItem(IDC_EDIT1)->GetWindowText(passw1);
|
||||||
|
int num = _ttoi(passw1);
|
||||||
|
if (num == num2) {
|
||||||
|
//this->ShowWindow(SW_HIDE);
|
||||||
|
yangchatmain dlg;
|
||||||
|
dlg.DoModal();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MessageBox(_T("密码错误,请重新输入或寻求开发者帮助。"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
37
YANG-ChatForMFC/YANG ChatDlg.h
Normal file
37
YANG-ChatForMFC/YANG ChatDlg.h
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
|
||||||
|
// YANG ChatDlg.h: 头文件
|
||||||
|
//
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
// CYANGChatDlg 对话框
|
||||||
|
class CYANGChatDlg : public CDialogEx
|
||||||
|
{
|
||||||
|
// 构造
|
||||||
|
public:
|
||||||
|
CYANGChatDlg(CWnd* pParent = nullptr); // 标准构造函数
|
||||||
|
|
||||||
|
// 对话框数据
|
||||||
|
#ifdef AFX_DESIGN_TIME
|
||||||
|
enum { IDD = IDD_YANG_CHAT_DIALOG };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||||
|
|
||||||
|
|
||||||
|
// 实现
|
||||||
|
protected:
|
||||||
|
HICON m_hIcon;
|
||||||
|
|
||||||
|
// 生成的消息映射函数
|
||||||
|
virtual BOOL OnInitDialog();
|
||||||
|
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||||
|
afx_msg void OnPaint();
|
||||||
|
afx_msg HCURSOR OnQueryDragIcon();
|
||||||
|
CString UTF8ToUnicode2(char* UTF8);
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
public:
|
||||||
|
afx_msg void OnBnClickedButton1();
|
||||||
|
};
|
BIN
YANG-ChatForMFC/YANGChat.rc
Normal file
BIN
YANG-ChatForMFC/YANGChat.rc
Normal file
Binary file not shown.
49
YANG-ChatForMFC/framework.h
Normal file
49
YANG-ChatForMFC/framework.h
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef VC_EXTRALEAN
|
||||||
|
#define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "targetver.h"
|
||||||
|
|
||||||
|
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
|
||||||
|
|
||||||
|
// 关闭 MFC 的一些常见且经常可放心忽略的隐藏警告消息
|
||||||
|
#define _AFX_ALL_WARNINGS
|
||||||
|
|
||||||
|
#include <afxwin.h> // MFC 核心组件和标准组件
|
||||||
|
#include <afxext.h> // MFC 扩展
|
||||||
|
|
||||||
|
|
||||||
|
#include <afxdisp.h> // MFC 自动化类
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef _AFX_NO_OLE_SUPPORT
|
||||||
|
#include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
|
||||||
|
#endif
|
||||||
|
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||||
|
#include <afxcmn.h> // MFC 对 Windows 公共控件的支持
|
||||||
|
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||||
|
|
||||||
|
#include <afxcontrolbars.h> // MFC 支持功能区和控制条
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _UNICODE
|
||||||
|
#if defined _M_IX86
|
||||||
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||||
|
#elif defined _M_X64
|
||||||
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||||
|
#else
|
||||||
|
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
5
YANG-ChatForMFC/pch.cpp
Normal file
5
YANG-ChatForMFC/pch.cpp
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
// pch.cpp: 与预编译标头对应的源文件
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
|
||||||
|
// 当使用预编译的头时,需要使用此源文件,编译才能成功。
|
13
YANG-ChatForMFC/pch.h
Normal file
13
YANG-ChatForMFC/pch.h
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
// pch.h: 这是预编译标头文件。
|
||||||
|
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
|
||||||
|
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
|
||||||
|
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
|
||||||
|
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
|
||||||
|
|
||||||
|
#ifndef PCH_H
|
||||||
|
#define PCH_H
|
||||||
|
|
||||||
|
// 添加要在此处预编译的标头
|
||||||
|
#include "framework.h"
|
||||||
|
|
||||||
|
#endif //PCH_H
|
BIN
YANG-ChatForMFC/res/YANG Chat.ico
Normal file
BIN
YANG-ChatForMFC/res/YANG Chat.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
YANG-ChatForMFC/res/YANGChat.rc2
Normal file
BIN
YANG-ChatForMFC/res/YANGChat.rc2
Normal file
Binary file not shown.
26
YANG-ChatForMFC/resource.h
Normal file
26
YANG-ChatForMFC/resource.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ 生成的包含文件。
|
||||||
|
// 供 YANGChat.rc 使用
|
||||||
|
//
|
||||||
|
#define IDM_ABOUTBOX 0x0010
|
||||||
|
#define IDD_ABOUTBOX 100
|
||||||
|
#define IDS_ABOUTBOX 101
|
||||||
|
#define IDD_YANG_CHAT_DIALOG 102
|
||||||
|
#define IDR_MAINFRAME 128
|
||||||
|
#define IDD_DIALOG1 129
|
||||||
|
#define IDC_BUTTON1 1000
|
||||||
|
#define IDC_RICHEDIT21 1001
|
||||||
|
#define IDC_EDIT1 1002
|
||||||
|
#define IDC_BUTTON2 1003
|
||||||
|
#define IDC_BUTTON3 1006
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 132
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1007
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
8
YANG-ChatForMFC/targetver.h
Normal file
8
YANG-ChatForMFC/targetver.h
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
|
||||||
|
|
||||||
|
//如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并
|
||||||
|
// 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
|
||||||
|
|
||||||
|
#include <SDKDDKVer.h>
|
162
YANG-ChatForMFC/yangchatmain.cpp
Normal file
162
YANG-ChatForMFC/yangchatmain.cpp
Normal file
|
@ -0,0 +1,162 @@
|
||||||
|
// yangchatmain.cpp: 实现文件
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "pch.h"
|
||||||
|
#include "YANG Chat.h"
|
||||||
|
#include "afxdialogex.h"
|
||||||
|
#include "yangchatmain.h"
|
||||||
|
#include <json/json.h>
|
||||||
|
#include <fstream>
|
||||||
|
#pragma warning(disable:4996)
|
||||||
|
// yangchatmain 对话框
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC(yangchatmain, CDialogEx)
|
||||||
|
|
||||||
|
yangchatmain::yangchatmain(CWnd* pParent /*=nullptr*/)
|
||||||
|
: CDialogEx(IDD_DIALOG1, pParent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
yangchatmain::~yangchatmain()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void yangchatmain::DoDataExchange(CDataExchange* pDX)
|
||||||
|
{
|
||||||
|
CDialogEx::DoDataExchange(pDX);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_MESSAGE_MAP(yangchatmain, CDialogEx)
|
||||||
|
ON_BN_CLICKED(IDC_BUTTON1, &yangchatmain::OnBnClickedButton1)
|
||||||
|
|
||||||
|
END_MESSAGE_MAP()
|
||||||
|
|
||||||
|
|
||||||
|
// yangchatmain 消息处理程序
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// pass1 消息处理程序
|
||||||
|
#include <afxinet.h>
|
||||||
|
CString yangchatmain::UTF8ToUnicode25(char* UTF8)
|
||||||
|
{
|
||||||
|
|
||||||
|
DWORD dwUnicodeLen; //转换后Unicode的长度
|
||||||
|
TCHAR* pwText; //保存Unicode的指针
|
||||||
|
CString strUnicode; //返回值
|
||||||
|
//获得转换后的长度,并分配内存
|
||||||
|
dwUnicodeLen = MultiByteToWideChar(CP_UTF8, 0, UTF8, -1, NULL, 0);
|
||||||
|
pwText = new TCHAR[dwUnicodeLen];
|
||||||
|
if (!pwText)
|
||||||
|
{
|
||||||
|
return strUnicode;
|
||||||
|
}
|
||||||
|
//转为Unicode
|
||||||
|
MultiByteToWideChar(CP_UTF8, 0, UTF8, -1, pwText, dwUnicodeLen);
|
||||||
|
//转为CString
|
||||||
|
strUnicode.Format(_T("%s"), pwText);
|
||||||
|
//清除内存
|
||||||
|
delete[]pwText;
|
||||||
|
//返回转换好的Unicode字串
|
||||||
|
return strUnicode;
|
||||||
|
}
|
||||||
|
#define _UNICODE
|
||||||
|
#include <tchar.h>
|
||||||
|
|
||||||
|
|
||||||
|
void yangchatmain::OnBnClickedButton1()
|
||||||
|
{
|
||||||
|
CString url2;
|
||||||
|
GetDlgItem(IDC_EDIT1)->GetWindowText(url2);
|
||||||
|
wchar_t* unicodeStr = url2.GetBuffer();
|
||||||
|
int unicodeLen = url2.GetLength();
|
||||||
|
|
||||||
|
std::string utf8Str;
|
||||||
|
for (int i = 0; i < unicodeLen; i++) {
|
||||||
|
wchar_t ch = unicodeStr[i];
|
||||||
|
if (ch < 0x80) {
|
||||||
|
utf8Str += static_cast<char>(ch);
|
||||||
|
}
|
||||||
|
else if (ch < 0x800) {
|
||||||
|
utf8Str += static_cast<char>((ch >> 6) | 0xc0);
|
||||||
|
utf8Str += static_cast<char>((ch & 0x3f) | 0x80);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
utf8Str += static_cast<char>((ch >> 12) | 0xe0);
|
||||||
|
utf8Str += static_cast<char>(((ch >> 6) & 0x3f) | 0x80);
|
||||||
|
utf8Str += static_cast<char>((ch & 0x3f) | 0x80);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CString encodedUrl;
|
||||||
|
int utf8Len = utf8Str.length();
|
||||||
|
for (int i = 0; i < utf8Len; i++) {
|
||||||
|
unsigned char ch = utf8Str[i];
|
||||||
|
char hexStr[4];
|
||||||
|
sprintf_s(hexStr, 4, "%%%02X", ch);
|
||||||
|
encodedUrl += CString(hexStr);
|
||||||
|
|
||||||
|
}
|
||||||
|
// TODO: 在此添加控件通知处理程序代码
|
||||||
|
int num2;
|
||||||
|
CString asd = _T("http://www.emmapi.com/chatgpt?text=");
|
||||||
|
CString asd1 = asd + encodedUrl;
|
||||||
|
// TODO: 在此添加控件通知处理程序代码
|
||||||
|
CInternetSession session(_T("HttpClient"));
|
||||||
|
TCHAR* url = asd1.GetBuffer();;//https://v1.apigpt.cn/?q=你好&apitype=sql
|
||||||
|
CHttpFile* pfile = (CHttpFile*)session.OpenURL(url);
|
||||||
|
DWORD dwStatusCode;
|
||||||
|
pfile->QueryInfoStatusCode(dwStatusCode);
|
||||||
|
if (dwStatusCode == HTTP_STATUS_OK)
|
||||||
|
{
|
||||||
|
CString content;
|
||||||
|
CString data;
|
||||||
|
while (pfile->ReadString(data))
|
||||||
|
{
|
||||||
|
content += data;
|
||||||
|
}
|
||||||
|
char* pch;
|
||||||
|
pch = new char[content.GetLength() * sizeof(TCHAR) + 1];
|
||||||
|
memcpy(pch, content, content.GetLength() * sizeof(TCHAR));
|
||||||
|
content = UTF8ToUnicode25(pch);//转换编码,不然就乱码了
|
||||||
|
//AfxMessageBox(content);
|
||||||
|
//CString content2;
|
||||||
|
// content2 = content.Left(content.Find('r'));
|
||||||
|
// content2 = content2.Right(content.GetLength() - 1 - content.ReverseFind(':'));
|
||||||
|
//CString contenta;
|
||||||
|
// contenta = content.Left(content.Find('a'));
|
||||||
|
//contenta = content.Right(content.GetLength() - 1 - content.ReverseFind(':'));
|
||||||
|
|
||||||
|
CString str = content;
|
||||||
|
Json::Reader reader;
|
||||||
|
Json::Value root;
|
||||||
|
CString temp;
|
||||||
|
CString temp2;
|
||||||
|
CString temp3;
|
||||||
|
CString temp4;
|
||||||
|
CString temp5;
|
||||||
|
CString temp6;
|
||||||
|
USES_CONVERSION;
|
||||||
|
char* cJson = T2A(str.GetBuffer(0));
|
||||||
|
str.ReleaseBuffer();
|
||||||
|
if (reader.parse(cJson, root)) {
|
||||||
|
temp = root["text"].asCString();
|
||||||
|
CString chatgpt = _T("YANG Chat:\n") + temp;
|
||||||
|
SetDlgItemText(IDC_RICHEDIT21, chatgpt);
|
||||||
|
//temp2 = root["data"][0]["desc"].asCString();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
pfile->Close();
|
||||||
|
delete pfile;
|
||||||
|
session.Close();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
27
YANG-ChatForMFC/yangchatmain.h
Normal file
27
YANG-ChatForMFC/yangchatmain.h
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#pragma once
|
||||||
|
#include "afxdialogex.h"
|
||||||
|
|
||||||
|
|
||||||
|
// yangchatmain 对话框
|
||||||
|
|
||||||
|
class yangchatmain : public CDialogEx
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC(yangchatmain)
|
||||||
|
|
||||||
|
public:
|
||||||
|
yangchatmain(CWnd* pParent = nullptr); // 标准构造函数
|
||||||
|
virtual ~yangchatmain();
|
||||||
|
|
||||||
|
// 对话框数据
|
||||||
|
#ifdef AFX_DESIGN_TIME
|
||||||
|
enum { IDD = IDD_DIALOG1 };
|
||||||
|
#endif
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||||
|
|
||||||
|
DECLARE_MESSAGE_MAP()
|
||||||
|
public:
|
||||||
|
afx_msg void OnBnClickedButton1();
|
||||||
|
CString UTF8ToUnicode25(char* UTF8);
|
||||||
|
};
|
37
YANG-ChatForQT/YANG-Chat.pro
Normal file
37
YANG-ChatForQT/YANG-Chat.pro
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
QT += core gui
|
||||||
|
QT += network
|
||||||
|
QT += core gui
|
||||||
|
QT += core gui sql
|
||||||
|
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||||
|
|
||||||
|
CONFIG += c++17
|
||||||
|
|
||||||
|
# You can make your code fail to compile if it uses deprecated APIs.
|
||||||
|
# In order to do so, uncomment the following line.
|
||||||
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
|
SOURCES += \
|
||||||
|
dialog.cpp \
|
||||||
|
main.cpp \
|
||||||
|
mainwindow.cpp
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
|
dialog.h \
|
||||||
|
mainwindow.h
|
||||||
|
|
||||||
|
FORMS += \
|
||||||
|
dialog.ui \
|
||||||
|
mainwindow.ui
|
||||||
|
|
||||||
|
TRANSLATIONS += \
|
||||||
|
YANG-Chat_zh_CN.ts
|
||||||
|
CONFIG += lrelease
|
||||||
|
CONFIG += embed_translations
|
||||||
|
|
||||||
|
# Default rules for deployment.
|
||||||
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
img.qrc
|
263
YANG-ChatForQT/YANG-Chat.pro.user
Normal file
263
YANG-ChatForQT/YANG-Chat.pro.user
Normal file
|
@ -0,0 +1,263 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE QtCreatorProject>
|
||||||
|
<!-- Written by QtCreator 10.0.0, 2023-06-28T02:13:31. -->
|
||||||
|
<qtcreator>
|
||||||
|
<data>
|
||||||
|
<variable>EnvironmentId</variable>
|
||||||
|
<value type="QByteArray">{5913d737-a7b3-40d5-81b3-ef43144c2778}</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||||
|
<value type="qlonglong">0</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||||
|
<value type="QString" key="language">Cpp</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||||
|
<value type="QString" key="language">QmlJS</value>
|
||||||
|
<valuemap type="QVariantMap" key="value">
|
||||||
|
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||||
|
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||||
|
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||||
|
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||||
|
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||||
|
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||||
|
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||||
|
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||||
|
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||||
|
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||||
|
<valuemap type="QVariantMap" key="ClangTools">
|
||||||
|
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||||
|
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||||
|
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||||
|
<value type="int" key="ClangTools.ParallelJobs">8</value>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||||
|
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||||
|
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||||
|
</valuemap>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||||
|
<valuemap type="QVariantMap">
|
||||||
|
<value type="QString" key="DeviceType">Desktop</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.6.0 MinGW 64-bit</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.6.0 MinGW 64-bit</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.dev.win64_mingw_kit</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||||
|
<value type="int" key="EnableQmlDebugging">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\qw200\Documents\C or C++ for YANG\build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Debug</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Debug</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\qw200\Documents\C or C++ for YANG\build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Release</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Release</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
|
<value type="int" key="QtQuickCompiler">0</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||||
|
<value type="int" key="EnableQmlDebugging">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\qw200\Documents\C or C++ for YANG\build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Profile</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Profile</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
|
||||||
|
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
|
||||||
|
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||||
|
</valuemap>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
|
||||||
|
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||||
|
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||||
|
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||||
|
<value type="int" key="QtQuickCompiler">0</value>
|
||||||
|
<value type="int" key="SeparateDebugInfo">0</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||||
|
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||||
|
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||||
|
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||||
|
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||||
|
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||||
|
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||||
|
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||||
|
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:C:/Users/qw200/Documents/C or C++ for YANG/YANG-Chat/YANG-Chat.pro</value>
|
||||||
|
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/qw200/Documents/C or C++ for YANG/YANG-Chat/YANG-Chat.pro</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||||
|
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||||
|
<value type="QString" key="RunConfiguration.WorkingDirectory.default">C:/Users/qw200/Documents/C or C++ for YANG/build-YANG-Chat-Desktop_Qt_6_6_0_MinGW_64_bit-Release</value>
|
||||||
|
</valuemap>
|
||||||
|
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||||
|
</valuemap>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||||
|
<value type="qlonglong">1</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||||
|
<value type="int">22</value>
|
||||||
|
</data>
|
||||||
|
<data>
|
||||||
|
<variable>Version</variable>
|
||||||
|
<value type="int">22</value>
|
||||||
|
</data>
|
||||||
|
</qtcreator>
|
BIN
YANG-ChatForQT/YANG-Chat_zh_CN.qm
Normal file
BIN
YANG-ChatForQT/YANG-Chat_zh_CN.qm
Normal file
Binary file not shown.
45
YANG-ChatForQT/YANG-Chat_zh_CN.ts
Normal file
45
YANG-ChatForQT/YANG-Chat_zh_CN.ts
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="zh_CN">
|
||||||
|
<context>
|
||||||
|
<name>Dialog</name>
|
||||||
|
<message>
|
||||||
|
<location filename="dialog.ui" line="14"/>
|
||||||
|
<source>Dialog</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="dialog.ui" line="37"/>
|
||||||
|
<source><html><head/><body><p><span style=" font-weight:700;">更新日志:</span></p><p>本次更新我正式将项目迁入QT开发中,完成了界面美化,</p><p>感谢各位长期以来对本项目的支持,本项目调用了ChatGPT API,</p><p>并使用代理服务器完成网络优化,</p><p>确保您能在国内不使用代理完成与ChatGPT服务器的请求。</p><p><span style=" font-weight:700;">开发者留言:</span></p><p>因此我需要自费购买代理服务器与ChatGPT API,</p><p>您的支持以确保我能继续更新下去,如果可以,请为我捐赠,</p><p>我将用于购买代理服务器来确保程序稳定性,感谢。</p><p><span style=" font-weight:700;">Donate</span></p><p>paypal:qw200477@163.com</p></body></html></source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>MainWindow</name>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="22"/>
|
||||||
|
<source>MainWindow</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="44"/>
|
||||||
|
<source><html><head/><body><p align="center">YANG-Chat</p></body></html></source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="99"/>
|
||||||
|
<source>启用间断对话</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="121"/>
|
||||||
|
<source>清除缓存</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.ui" line="149"/>
|
||||||
|
<source>发送</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
89
YANG-ChatForQT/dialog.cpp
Normal file
89
YANG-ChatForQT/dialog.cpp
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
#include "dialog.h"
|
||||||
|
#include "ui_dialog.h"
|
||||||
|
#include <QJsonArray>
|
||||||
|
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QEventLoop>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QtWidgets>
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QMessageBox>
|
||||||
|
Dialog::Dialog(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::Dialog)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
Dialog::~Dialog()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Dialog::on_pushButton_clicked()
|
||||||
|
{
|
||||||
|
|
||||||
|
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
||||||
|
QUrl url("https://api.vvhan.com/api/qqsc?key=492fa5701060de4b2f30e08cbbe2defe");
|
||||||
|
QNetworkRequest request(url);
|
||||||
|
|
||||||
|
// Set unsafe SSL configuration
|
||||||
|
QSslConfiguration config = request.sslConfiguration();
|
||||||
|
config.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||||
|
request.setSslConfiguration(config);
|
||||||
|
|
||||||
|
QNetworkReply *reply = manager->get(request);
|
||||||
|
|
||||||
|
// Connect to the finished signal
|
||||||
|
connect(reply, &QNetworkReply::finished, [=]() {
|
||||||
|
|
||||||
|
if (reply->error() == QNetworkReply::NoError) {
|
||||||
|
// Read the JSON data
|
||||||
|
QByteArray data = reply->readAll();
|
||||||
|
|
||||||
|
// Display the JSON data in a message box
|
||||||
|
|
||||||
|
// QMessageBox::information(this, "JSON Data", QString(data));
|
||||||
|
QJsonDocument jsonDoc = QJsonDocument::fromJson(QString(data).toUtf8());
|
||||||
|
QJsonObject jsonObj = jsonDoc.object();
|
||||||
|
|
||||||
|
// 获取数据
|
||||||
|
QString answer = jsonObj["text"].toString();
|
||||||
|
if(answer=="75842"){
|
||||||
|
MainWindow w;
|
||||||
|
w.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Display an error message
|
||||||
|
|
||||||
|
QMessageBox::warning(this, "Error", reply->errorString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
reply->deleteLater();
|
||||||
|
manager->deleteLater();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
25
YANG-ChatForQT/dialog.h
Normal file
25
YANG-ChatForQT/dialog.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef DIALOG_H
|
||||||
|
#define DIALOG_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class Dialog;
|
||||||
|
}
|
||||||
|
|
||||||
|
class Dialog : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit Dialog(QWidget *parent = nullptr);
|
||||||
|
~Dialog();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_pushButton_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::Dialog *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DIALOG_H
|
171
YANG-ChatForQT/dialog.ui
Normal file
171
YANG-ChatForQT/dialog.ui
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Dialog</class>
|
||||||
|
<widget class="QDialog" name="Dialog">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>618</width>
|
||||||
|
<height>428</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>您的捐赠是我更新的动力</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget" native="true">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>380</width>
|
||||||
|
<height>180</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>380</width>
|
||||||
|
<height>600</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QWidget{background:rgb(170, 255, 255);border:2px groove gray;border-radius:30px;padding:2px 4px;border-style: outset;font: 16pt "华文琥珀";}</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>161</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">border-image: url(:/Desktop/39414350.jpg);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>190</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>181</width>
|
||||||
|
<height>41</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">background-color: rgb(255, 255, 0);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center">YANG-Chat</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_6">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>190</x>
|
||||||
|
<y>60</y>
|
||||||
|
<width>181</width>
|
||||||
|
<height>111</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-size:10pt;">版本号:V6.1正式版</span></p><p><span style=" font-size:10pt;">项目已接入ChatGPT,</span></p><p><span style=" font-size:10pt;">如遇问题,请在GITHUB向我提出,</span></p><p><span style=" font-size:10pt;">我将会及时修复。</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>9</x>
|
||||||
|
<y>180</y>
|
||||||
|
<width>361</width>
|
||||||
|
<height>221</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">padding:5px 5px;</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p><span style=" font-size:14pt; font-weight:700;">开发者留言:</span></p><p><span style=" font-size:14pt;">我需要自费购买代理服务器与ChatGPT API,</span></p><p><span style=" font-size:14pt;">您的支持以确保我能继续更新下去,如果可以,请为我捐赠,</span></p><p><span style=" font-size:14pt;">我将用于购买代理服务器来确保程序稳定性,感谢。</span></p><p><span style=" font-size:14pt; font-weight:700;">Donate</span></p><p><span style=" font-size:14pt;">paypal:qw200477@163.com</span></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">border-image: url(:/Desktop/6b73c9ae58aaad1b631e73f3dd357e9.jpg);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>210</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">border-image: url(:/Desktop/a1bf4725bee712e6916866de02eb50f.png);</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
7
YANG-ChatForQT/img.qrc
Normal file
7
YANG-ChatForQT/img.qrc
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>../../../Desktop/39414350.jpg</file>
|
||||||
|
<file>../../../Desktop/6b73c9ae58aaad1b631e73f3dd357e9.jpg</file>
|
||||||
|
<file>../../../Desktop/a1bf4725bee712e6916866de02eb50f.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
32
YANG-ChatForQT/main.cpp
Normal file
32
YANG-ChatForQT/main.cpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
#include "dialog.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
|
#include <QLocale>
|
||||||
|
#include <QTranslator>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
|
QTranslator translator;
|
||||||
|
const QStringList uiLanguages = QLocale::system().uiLanguages();
|
||||||
|
for (const QString &locale : uiLanguages) {
|
||||||
|
const QString baseName = "YANG-Chat_" + QLocale(locale).name();
|
||||||
|
if (translator.load(":/i18n/" + baseName)) {
|
||||||
|
a.installTranslator(&translator);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow w;
|
||||||
|
w.show();
|
||||||
|
// Dialog ws;
|
||||||
|
// ws.show();
|
||||||
|
|
||||||
|
//获取可用桌面大小
|
||||||
|
// 禁止拖动窗口大小
|
||||||
|
|
||||||
|
return a.exec();
|
||||||
|
}
|
424
YANG-ChatForQT/mainwindow.cpp
Normal file
424
YANG-ChatForQT/mainwindow.cpp
Normal file
|
@ -0,0 +1,424 @@
|
||||||
|
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "ui_mainwindow.h"
|
||||||
|
|
||||||
|
#include <QJsonArray>
|
||||||
|
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QEventLoop>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QtWidgets>
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QNetworkAccessManager>
|
||||||
|
#include <QNetworkReply>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QSqlError>
|
||||||
|
#include <QSqlDatabase>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QSqlQuery>
|
||||||
|
QString strall;
|
||||||
|
QString discuss;
|
||||||
|
QString ask;
|
||||||
|
QString answer;
|
||||||
|
bool checked1;
|
||||||
|
bool checked2;
|
||||||
|
QString rev;
|
||||||
|
int pass=1;
|
||||||
|
int passint;
|
||||||
|
int sgin=0;
|
||||||
|
QString ves="V7.0";
|
||||||
|
QString updata="您现在使用的是内部版本,严禁传播至公共网络。(每位开发者认识的用户仅可以邀请2位开发者未知的用户,违者永久删除YANG数据库信息)\n\n更新日志:\n为帮助大家期末不挂科,我再次更新了本程序,祝大家期末顺利!\n1.全面升级为ChatGPT3.5版本,提升AI智力。\n2.加入全局数据库,使用本程序需要注册YANG程序账户。\n3.使用官方大数据模型,全面提升AI运行速度。\n4.使用POST请求,不再受url进行字数限制。";
|
||||||
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
|
: QMainWindow(parent)
|
||||||
|
, ui(new Ui::MainWindow)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
// 连接数据库
|
||||||
|
|
||||||
|
// setWindowFlags(windowFlags()&~Qt::WindowMaximizeButtonHint); // 禁止最大化按钮
|
||||||
|
// setFixedSize(1400,1400); // 禁止拖动窗口大小
|
||||||
|
ui->setupUi(this);
|
||||||
|
// QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
||||||
|
// QUrl url("https://apis.jxcxin.cn/api/qqcollection?url=https://sharechain.qq.com/d0bad3425fe73b651253c3dea47c759d");
|
||||||
|
// QNetworkRequest request(url);
|
||||||
|
|
||||||
|
// Set unsafe SSL configuration
|
||||||
|
// QSslConfiguration config = request.sslConfiguration();
|
||||||
|
// config.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||||
|
// request.setSslConfiguration(config);
|
||||||
|
|
||||||
|
// QNetworkReply *reply = manager->get(request);
|
||||||
|
|
||||||
|
// Connect to the finished signal
|
||||||
|
// connect(reply, &QNetworkReply::finished, [=]() {
|
||||||
|
|
||||||
|
// if (reply->error() == QNetworkReply::NoError) {
|
||||||
|
// Read the JSON data
|
||||||
|
// QByteArray data = reply->readAll();
|
||||||
|
|
||||||
|
// Display the JSON data in a message box
|
||||||
|
|
||||||
|
// QMessageBox::information(this, "JSON Data", QString(data));
|
||||||
|
// QJsonDocument jsonDoc = QJsonDocument::fromJson(QString(data).toUtf8());
|
||||||
|
// QJsonObject jsonObj = jsonDoc.object();
|
||||||
|
|
||||||
|
// 获取数据
|
||||||
|
// QJsonObject jObj2 = jsonDoc["data"].toObject();
|
||||||
|
//获取jObj2中指定键的值(值对应的类型直接使用对应函数转)
|
||||||
|
// QString key1Val = jObj2["content"].toString();
|
||||||
|
|
||||||
|
ui->textBrowser->setPlainText("当前版本:YANG-Chat V7.0 Insider Preview\n\n公告:\n"+updata);
|
||||||
|
|
||||||
|
|
||||||
|
// } else {
|
||||||
|
// Display an error message
|
||||||
|
|
||||||
|
// QMessageBox::warning(this, "Error", reply->errorString());
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
// reply->deleteLater();
|
||||||
|
// manager->deleteLater();
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
QSettings *regDataSrc=new QSettings("HKEY_CURRENT_USER\\SOFTWARE\\ODBC\\ODBC.INI\\ODBC Data Sources", QSettings::NativeFormat);
|
||||||
|
regDataSrc->setValue("jasonyang17", "MySQL ODBC 8.0 ANSI Driver");//创建数据源
|
||||||
|
delete regDataSrc;
|
||||||
|
regDataSrc = nullptr;
|
||||||
|
|
||||||
|
//配置MySQL DSN
|
||||||
|
QString Key= QString("HKEY_CURRENT_USER\\SOFTWARE\\ODBC\\ODBC.INI\\%1").arg("jasonyang17");
|
||||||
|
qDebug()<<Key;
|
||||||
|
QSettings *regConfigDSN=new QSettings(Key, QSettings::NativeFormat);
|
||||||
|
regConfigDSN->setValue(".", "");
|
||||||
|
regConfigDSN->setValue("DESCRIPTION", "yangchat");//写描述项
|
||||||
|
QSettings *regMySQLDriverPath = new QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\ODBC\\ODBCINST.INI\\MySQL ODBC 8.0 ANSI Driver", QSettings::NativeFormat);
|
||||||
|
QString MySQLDrvPath = regMySQLDriverPath->value("Driver").toString();
|
||||||
|
regConfigDSN->setValue("Driver", MySQLDrvPath/*"D:\\Program Files\\MySQL\\Connector ODBC 8.0\\myodbc8a.dll"*/);//MySQL驱动程序路径
|
||||||
|
regConfigDSN->setValue("SERVER","mysql.sqlpub.com");//MySQL服务器地址
|
||||||
|
regConfigDSN->setValue("PORT",3306);//MySQL服务器端口号
|
||||||
|
regConfigDSN->setValue("UID", "jasonyang17");//用户名
|
||||||
|
regConfigDSN->setValue("PWD", "a0744a2eed110525");//密码
|
||||||
|
delete regConfigDSN;
|
||||||
|
regConfigDSN = nullptr;
|
||||||
|
delete regMySQLDriverPath;
|
||||||
|
regMySQLDriverPath = nullptr;
|
||||||
|
|
||||||
|
// );
|
||||||
|
QNetworkAccessManager *manager2 = new QNetworkAccessManager(this);
|
||||||
|
QUrl url2("https://apis.jxcxin.cn/api/qqcollection?url=https://sharechain.qq.com/8f2807e6a7ebfbc168f4a1ecad286283");
|
||||||
|
QNetworkRequest request2(url2);
|
||||||
|
|
||||||
|
// Set unsafe SSL configuration
|
||||||
|
QSslConfiguration config2 = request2.sslConfiguration();
|
||||||
|
config2.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||||
|
request2.setSslConfiguration(config2);
|
||||||
|
|
||||||
|
QNetworkReply *reply2 = manager2->get(request2);
|
||||||
|
|
||||||
|
// Connect to the finished signal
|
||||||
|
connect(reply2, &QNetworkReply::finished, [=]() {
|
||||||
|
|
||||||
|
if (reply2->error() == QNetworkReply::NoError) {
|
||||||
|
// Read the JSON data
|
||||||
|
QByteArray data2 = reply2->readAll();
|
||||||
|
|
||||||
|
// Display the JSON data in a message box
|
||||||
|
|
||||||
|
// QMessageBox::information(this, "JSON Data", QString(data));
|
||||||
|
QJsonDocument jsonDoc2 = QJsonDocument::fromJson(QString(data2).toUtf8());
|
||||||
|
|
||||||
|
|
||||||
|
// 获取数据
|
||||||
|
// 获取数据
|
||||||
|
QJsonObject jObj23 = jsonDoc2["data"].toObject();
|
||||||
|
//获取jObj2中指定键的值(值对应的类型直接使用对应函数转)
|
||||||
|
QString info2= jObj23["content"].toString();
|
||||||
|
if(info2!=ves){
|
||||||
|
QMessageBox::warning(this, "Error", "已发布新版本\""+info2+"\"。\n点击右上角发现新版本按钮下载最新版本。");
|
||||||
|
ui->pushButton_4->setText("发现新版本");
|
||||||
|
}else{
|
||||||
|
|
||||||
|
|
||||||
|
ui->pushButton_4->setText("暂无更新");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Display an error message
|
||||||
|
|
||||||
|
QMessageBox::warning(this, "Error", reply2->errorString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
reply2->deleteLater();
|
||||||
|
manager2->deleteLater();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
MainWindow::~MainWindow()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_pushButton_clicked()
|
||||||
|
{
|
||||||
|
if(checked2){
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
}
|
||||||
|
if(sgin==2){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ui->textBrowser->setPlainText("正在等待ChatGPT回答您的问题,请稍等......");
|
||||||
|
ask=ui->textEdit->toPlainText();
|
||||||
|
discuss=discuss+"Q:"+ask+"A:";
|
||||||
|
QString test2;"ESP8266控制电路数据上传:"+ask;
|
||||||
|
qDebug() << "ESP8266控制电路数据上传:"+ui->textEdit->toPlainText();;
|
||||||
|
// if(ask.length()>880){
|
||||||
|
// QMessageBox::warning(this, "Error", "长度超出限制,当前共"+QString::number(ask.length())+"字节\n请删除部分字符使其控制在880字节以内。");
|
||||||
|
//}
|
||||||
|
if(checked1){
|
||||||
|
discuss="";
|
||||||
|
}
|
||||||
|
|
||||||
|
int num=0;
|
||||||
|
|
||||||
|
QNetworkAccessManager manager;
|
||||||
|
|
||||||
|
// 创建POST请求
|
||||||
|
QUrl url("https://aigptx.top/api/v1/ai/chatgpt/chat"); // 更换为你要访问的API地址
|
||||||
|
QNetworkRequest request(url);
|
||||||
|
QString accessToken = "eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ2ODYiLCJlbWFpbCI6InF3MjAwNDc3QDE2My5jb20iLCJwdXJwb3NlIjoid2ViIiwiaWF0IjoxNjg2ODUwNjY4LCJleHAiOjE2ODgwNjAyNjh9.AddJmMGxYuYH1uIPWzO2mFAjuBCGcJKpApeOiKEK46CeP3pMKk0JYSycETDOtMKJN0ytVOyn-gaPD4gGq79cC7evAJ_as6jpDFJexN2fhE_GwHxQoARcIpVeifx1-QT4d5Tb1_u26-_8m0TjMNgMeAtXrSM8g5j2WrAZCJCvXlJTqJ_W";
|
||||||
|
QByteArray authHeader = "Bearer " + accessToken.toUtf8();
|
||||||
|
|
||||||
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
|
||||||
|
request.setRawHeader("Authorization", authHeader);
|
||||||
|
// 准备POST数据
|
||||||
|
QByteArray postData;
|
||||||
|
postData.append("session_id=9a77571d-b687-4325-bbff-716ff1466ea2&content=[{\"role\":\"system\",\"content\":\"You are YANG Chat3.5, a large language model trained by YANG.\"},{\"role\":\"user\",\"content\":\""+discuss.toUtf8()+"\"}]&max_context_length=5¶ms={\"model\":\"gpt-3.5-turbo\",\"temperature\":1,\"max_tokens\":2048,\"presence_penalty\":0,\"frequency_penalty\":0,\"max_context_length\":5,\"voiceShortName\":\"zh-CN-XiaoxiaoNeural\",\"rate\":1,\"pitch\":1}"); // 根据API要求,构建合适的POST参数
|
||||||
|
|
||||||
|
// 发送POST请求
|
||||||
|
QNetworkReply *reply = manager.post(request, postData);
|
||||||
|
|
||||||
|
// 等待请求完成
|
||||||
|
QEventLoop loop;
|
||||||
|
QObject::connect(reply, &QNetworkReply::finished, &loop, &QEventLoop::quit);
|
||||||
|
loop.exec();
|
||||||
|
QString str1="You:\n"+ask+"\n\n";
|
||||||
|
|
||||||
|
// 获取返回值
|
||||||
|
if(reply->error() == QNetworkReply::NoError) {
|
||||||
|
QString response = reply->readAll();
|
||||||
|
QString str2="YANG Chat:\n"+response+"\n\n";
|
||||||
|
strall=strall+str1+str2;
|
||||||
|
ui->textBrowser->setPlainText(strall);
|
||||||
|
QString test1="AI数据应答:"+response;
|
||||||
|
qDebug() << test1;
|
||||||
|
} else {
|
||||||
|
qDebug() << "Error:" << reply->errorString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理
|
||||||
|
reply->deleteLater();
|
||||||
|
}
|
||||||
|
else if(sgin==0){
|
||||||
|
ui->textBrowser->setPlainText("您还未登录,请先输入密钥后点击登录。");
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
ui->textBrowser->setPlainText("密钥错误,请重新登录或与开发者联系。");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_pushButton_2_clicked()
|
||||||
|
{
|
||||||
|
|
||||||
|
discuss="";
|
||||||
|
ui->textBrowser->setPlainText("");
|
||||||
|
QMessageBox::warning(this, "Clean", "聊天记录已清除");
|
||||||
|
}
|
||||||
|
int len23=0;
|
||||||
|
QString user;
|
||||||
|
void MainWindow::on_pushButton_3_clicked()
|
||||||
|
|
||||||
|
{
|
||||||
|
// ui->textEdit->setPlainText("");
|
||||||
|
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
||||||
|
QUrl url("https://apis.jxcxin.cn/api/qqcollection?url=https://sharechain.qq.com/492fa5701060de4b2f30e08cbbe2defe");
|
||||||
|
QNetworkRequest request(url);
|
||||||
|
|
||||||
|
// Set unsafe SSL configuration
|
||||||
|
QSslConfiguration config = request.sslConfiguration();
|
||||||
|
config.setPeerVerifyMode(QSslSocket::VerifyNone);
|
||||||
|
request.setSslConfiguration(config);
|
||||||
|
//
|
||||||
|
QNetworkReply *reply = manager->get(request);
|
||||||
|
|
||||||
|
// Connect to the finished signal
|
||||||
|
connect(reply, &QNetworkReply::finished, [=]() {
|
||||||
|
|
||||||
|
if (reply->error() == QNetworkReply::NoError) {
|
||||||
|
// Read the JSON data
|
||||||
|
QByteArray data = reply->readAll();
|
||||||
|
|
||||||
|
// Display the JSON data in a message box
|
||||||
|
|
||||||
|
// QMessageBox::information(this, "JSON Data", QString(data));
|
||||||
|
QJsonDocument jsonDoc = QJsonDocument::fromJson(QString(data).toUtf8());
|
||||||
|
QJsonObject jObj2 = jsonDoc["data"].toObject();
|
||||||
|
//获取jObj2中指定键的值(值对应的类型直接使用对应函数转)
|
||||||
|
int pass33d = jObj2["content"].toString().toInt();
|
||||||
|
|
||||||
|
int pass22d=ui->textEdit->toPlainText().toInt();
|
||||||
|
qDebug() << pass33d;
|
||||||
|
qDebug() << pass22d;
|
||||||
|
if(pass22d==pass33d-2004&&pass!=NULL){
|
||||||
|
|
||||||
|
ui->textBrowser->setPlainText("登录完成,请输入您的问题并点击发送。");
|
||||||
|
|
||||||
|
sgin=2;
|
||||||
|
}else{
|
||||||
|
ui->textBrowser->setPlainText("登录失败,请使用73838公共密钥");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Display an error message
|
||||||
|
|
||||||
|
QMessageBox::warning(this, "Error", reply->errorString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
reply->deleteLater();
|
||||||
|
manager->deleteLater();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
// 检查查询结果
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_checkBox_clicked(bool checked)
|
||||||
|
{
|
||||||
|
checked1=checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_checkBox_2_clicked(bool checked)
|
||||||
|
{
|
||||||
|
checked2=checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "QDesktopServices"
|
||||||
|
#include "QUrl"
|
||||||
|
void MainWindow::on_pushButton_4_clicked()
|
||||||
|
{
|
||||||
|
|
||||||
|
QDesktopServices::openUrl(QUrl("https://github.com/JasonYANG170/YANG-Chat/releases", QUrl::TolerantMode));
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "QNetworkproxy"
|
||||||
|
QString user1;
|
||||||
|
QString pass1;
|
||||||
|
QString name1;
|
||||||
|
QString invite1;
|
||||||
|
int len223;
|
||||||
|
void MainWindow::on_pushButton_5_clicked()
|
||||||
|
{
|
||||||
|
QString pass;
|
||||||
|
if(len223==0){
|
||||||
|
ui->textBrowser->setPlainText("请输入您需要注册的账户名\n(请记住您的用户名)\n点击注册YANG账户进入下一步");
|
||||||
|
len223=1;
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
}else if(len223==1){
|
||||||
|
len223=2;
|
||||||
|
|
||||||
|
user1=ui->textEdit->toPlainText();
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
ui->textBrowser->setPlainText("请输入您需要注册的账户密钥\n(请记住您的密码)\n点击注册YANG账户进入下一步");
|
||||||
|
|
||||||
|
}else if(len223==2){
|
||||||
|
ui->textBrowser->setPlainText("请输入您真实姓名\n(开发者未知的用户将会在服务器中删除您全部数据)\n点击注册YANG账户进入下一步");
|
||||||
|
len223=3;
|
||||||
|
pass1=ui->textEdit->toPlainText();
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
}else if(len223==3){
|
||||||
|
len223=4;
|
||||||
|
|
||||||
|
name1=ui->textEdit->toPlainText();
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
ui->textBrowser->setPlainText("请输入您的邀请人的真实姓名\n(每位开发者已知用户允许邀请2位用户,超出将删除您的全部数据。)\n点击注册YANG账户进入下一步");
|
||||||
|
|
||||||
|
}else if(len223==4){
|
||||||
|
|
||||||
|
invite1=ui->textEdit->toPlainText();
|
||||||
|
ui->textBrowser->setPlainText("请等待服务器完成对您的账户注册......");
|
||||||
|
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
|
||||||
|
db.setHostName("mysql.sqlpub.com"); // localhost
|
||||||
|
db.setPort(3306); // mysql默认端口号
|
||||||
|
db.setDatabaseName("jasonyang17"); // 需要连接的数据库名
|
||||||
|
db.setUserName("jasonyang17"); // mysql用户名
|
||||||
|
db.setPassword("a0744a2eed110525"); // mysql密码
|
||||||
|
bool ok = db.open();
|
||||||
|
if (!db.open()) {
|
||||||
|
qDebug() << "无法打开数据库";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QString tableName = "yang";
|
||||||
|
|
||||||
|
// 执行插入语句
|
||||||
|
QSqlQuery query;
|
||||||
|
QString queryString = QString("INSERT INTO %1 (id, pass,name,invite) VALUES ('%2', '%3','%4', '%5');").arg(tableName, user1, pass1,name1, invite1);
|
||||||
|
if (!query.exec(queryString)) {
|
||||||
|
qDebug() << "插入数据失败:" << query.lastError().text();
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
ui->textBrowser->setPlainText("注册失败,请检查您的网络连接或联系开发者。");
|
||||||
|
len223=0;
|
||||||
|
} else {
|
||||||
|
qDebug() << "插入数据成功";
|
||||||
|
ui->textEdit->setPlainText("");
|
||||||
|
ui->textBrowser->setPlainText("注册完成,您现在可以登录了。\n\n请牢记您的账户信息:\n用户名:"+user1+"\n密码"+pass1+"\n\n感谢您对本项目的支持,您的账户将适用于所有YANG的软硬件开发项目与全部服务支持。");
|
||||||
|
len223=5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭数据库连接
|
||||||
|
db.close();
|
||||||
|
|
||||||
|
}else if(len223==5){
|
||||||
|
ui->textBrowser->setPlainText("您已经完成了注册,请勿重复注册!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
46
YANG-ChatForQT/mainwindow.h
Normal file
46
YANG-ChatForQT/mainwindow.h
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
#ifndef MAINWINDOW_H
|
||||||
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
namespace Ui { class MainWindow; }
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
class MainWindow : public QMainWindow
|
||||||
|
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
MainWindow(QWidget *parent = nullptr);
|
||||||
|
~MainWindow();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_pushButton_clicked();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void on_pushButton_2_clicked();
|
||||||
|
|
||||||
|
void on_pushButton_3_clicked();
|
||||||
|
|
||||||
|
|
||||||
|
void on_checkBox_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_checkBox_2_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_pushButton_4_clicked();
|
||||||
|
|
||||||
|
void on_pushButton_5_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::MainWindow *ui;
|
||||||
|
bool print_lock;
|
||||||
|
bool stop_flag;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MAINWINDOW_H
|
265
YANG-ChatForQT/mainwindow.ui
Normal file
265
YANG-ChatForQT/mainwindow.ui
Normal file
|
@ -0,0 +1,265 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>500</width>
|
||||||
|
<height>362</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<kerning>false</kerning>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>YANG Chat V7.0</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Maximum</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>50</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>35</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">font: 20pt "华文琥珀";</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p align="center">YANG-Chat</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_4">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{background-color: rgb(255, 255, 0);border:2px groove gray;border-radius:8px;padding:2px 4px;border-style: outset;font:700 9pt "幼圆";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QPushButton:hover{background-color:rgb(229, 241, 251); color: black;}
|
||||||
|
QPushButton:pressed{background-color:rgb(204, 228, 247);border-style: inset;}</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>更新</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextBrowser" name="textBrowser">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">
|
||||||
|
font: 12pt "幼圆";
|
||||||
|
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="textEdit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>55</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>启用间断对话</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_5">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{background-color: rgb(255, 255, 0);border:2px groove gray;border-radius:8px;padding:2px 4px;border-style: outset;font:700 9pt "幼圆";}
|
||||||
|
QPushButton:hover{background-color:rgb(229, 241, 251); color: black;}
|
||||||
|
QPushButton:pressed{background-color:rgb(204, 228, 247);border-style: inset;}</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>注册YANG账户</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>自动清除输入框</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_3">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{background-color: rgb(170, 255, 0);border:2px groove gray;border-radius:8px;padding:2px 4px;border-style: outset;font:700 9pt "幼圆";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QPushButton:hover{background-color:rgb(229, 241, 251); color: black;}
|
||||||
|
QPushButton:pressed{background-color:rgb(204, 228, 247);border-style: inset;}</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>登录</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_2">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>30</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{background-color:rgb(255, 170, 0); ;border:2px groove gray;border-radius:8px;padding:2px 4px;border-style: outset;font:700 9pt "幼圆";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QPushButton:hover{background-color:rgb(229, 241, 251); color: black;}
|
||||||
|
QPushButton:pressed{background-color:rgb(204, 228, 247);border-style: inset;}</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>清除缓存</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>60</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QPushButton{ background-color: rgb(0, 255, 255);;border:2px groove gray;border-radius:20px;padding:2px 4px;border-style: outset;font: 16pt "华文琥珀";}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
QPushButton:hover{background-color:rgb(229, 241, 251); color: black;}
|
||||||
|
QPushButton:pressed{background-color:rgb(204, 228, 247);border-style: inset;}</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>发送</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>500</width>
|
||||||
|
<height>18</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
25
YANG-ChatForQT/user.h
Normal file
25
YANG-ChatForQT/user.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#ifndef USER_H
|
||||||
|
#define USER_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class user;
|
||||||
|
}
|
||||||
|
|
||||||
|
class user : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit user(QWidget *parent = nullptr);
|
||||||
|
~user();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_pushButton_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::user *ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // USER_H
|
81
YANG-ChatForQT/user.ui
Normal file
81
YANG-ChatForQT/user.ui
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>user</class>
|
||||||
|
<widget class="QDialog" name="user">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Dialog</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>240</y>
|
||||||
|
<width>341</width>
|
||||||
|
<height>32</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>260</x>
|
||||||
|
<y>170</y>
|
||||||
|
<width>80</width>
|
||||||
|
<height>19</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>PushButton</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>user</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>user</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
Loading…
Reference in New Issue
Block a user