实现基本功能
This commit is contained in:
parent
cd11699939
commit
a954394004
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 6.0.2, 2023-01-07T15:19:05. -->
|
||||
<!-- Written by QtCreator 6.0.2, 2023-01-08T00:28:02. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -85,9 +85,6 @@
|
|||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="CppEditor.QuickFix">
|
||||
<value type="bool" key="UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
|
@ -97,52 +94,12 @@
|
|||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.2.3 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.2.3 MinGW 64-bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.623.win64_mingw_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">2</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\25761\Desktop\build-TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/build-TcpClient-Desktop_Qt_6_2_3_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\25761\Desktop\build-TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/build-TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\25761\Desktop\Error-in-"-Util.asciify("build-C:\Users\25761\Desktop\tcpclient\TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Release")":-SyntaxError:-Expected-token-`)'</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/Error-in-"-Util.asciify("build-C:/Users/25761/Desktop/tcpclient/TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Release")":-SyntaxError:-Expected-token-`)'</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>
|
||||
|
@ -180,10 +137,10 @@
|
|||
<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">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\25761\Desktop\build-TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/build-TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\25761\Desktop\Error-in-"-Util.asciify("build-C:\Users\25761\Desktop\tcpclient\TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Profile")":-SyntaxError:-Expected-token-`)'</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/Error-in-"-Util.asciify("build-C:/Users/25761/Desktop/tcpclient/TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Profile")":-SyntaxError:-Expected-token-`)'</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>
|
||||
|
@ -222,6 +179,46 @@
|
|||
<value type="int" key="QtQuickCompiler">0</value>
|
||||
<value type="int" key="SeparateDebugInfo">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\25761\Desktop\build-TCPClient-Desktop_Qt_6_2_3_MinGW_64_bit-111</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/build-TCPClient-Desktop_Qt_6_2_3_MinGW_64_bit-111</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">111</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</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">
|
||||
|
@ -250,98 +247,14 @@
|
|||
<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/25761/Desktop/build-TcpClient-Desktop_Qt_6_2_3_MinGW_64_bit-Debug</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.1</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.2.3 MSVC2019 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.2.3 MSVC2019 64bit</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.623.win64_msvc2019_64_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</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\25761\Desktop\Error-in-"-Util.asciify("build-C:\Users\25761\Desktop\tcpclient\TcpClient-Desktop_Qt_6_2_3_MSVC2019_64bit-Profile")":-SyntaxError:-Expected-token-`)'</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/25761/Desktop/Error-in-"-Util.asciify("build-C:/Users/25761/Desktop/tcpclient/TcpClient-Desktop_Qt_6_2_3_MSVC2019_64bit-Profile")":-SyntaxError:-Expected-token-`)'</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">1</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/25761/Desktop/tcpclient/TcpClient.pro</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/Users/25761/Desktop/tcpclient/TcpClient.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/25761/Desktop/build-TCPClient-Desktop_Qt_6_2_3_MinGW_64_bit-111</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="qlonglong">2</value>
|
||||
<value type="qlonglong">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
|
|
119
datamanager.cpp
119
datamanager.cpp
|
@ -1,21 +1,20 @@
|
|||
#include "datamanager.h"
|
||||
//DataManager* DataManager::p_this;
|
||||
// DataManager* DataManager::p_this;
|
||||
DataManager::DataManager(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
qDebug() << "进入DataManager的构造函数";
|
||||
tcpclient = TCPClient::getInstance();
|
||||
connect(tcpclient,&TCPClient::TCPClientConnected,this,&DataManager::TCPClientConnected);
|
||||
connect(tcpclient,&TCPClient::TCPClientDisconnected,this,&DataManager::TCPClientDisconnected);
|
||||
connect(tcpclient,&TCPClient::recv_data,this,&DataManager::recv_from_server);
|
||||
connect(tcpclient, &TCPClient::TCPClientConnected, this, &DataManager::TCPClientConnected);
|
||||
connect(tcpclient, &TCPClient::TCPClientDisconnected, this, &DataManager::TCPClientDisconnected);
|
||||
connect(tcpclient, &TCPClient::recv_data, this, &DataManager::recv_from_server);
|
||||
tcpclient->configAndrun();
|
||||
//tcpclient->setCallBack(recv_from_server);
|
||||
// tcpclient->setCallBack(recv_from_server);
|
||||
protocol = Protocol::getInstance();
|
||||
//p_this = this;
|
||||
|
||||
// p_this = this;
|
||||
}
|
||||
|
||||
DataManager* DataManager::getInstance()
|
||||
DataManager *DataManager::getInstance()
|
||||
{
|
||||
static DataManager datamanager_instance;
|
||||
return &datamanager_instance;
|
||||
|
@ -32,7 +31,7 @@ void DataManager::TCPClientDisconnected()
|
|||
{
|
||||
connect_flag = false;
|
||||
qDebug() << "emit disconnect_from_server successfully";
|
||||
//emit p_this->disconnect_from_server();
|
||||
// emit p_this->disconnect_from_server();
|
||||
emit disconnect_from_server();
|
||||
}
|
||||
|
||||
|
@ -40,29 +39,32 @@ void DataManager::recv_from_server(QByteArray data)
|
|||
{
|
||||
QByteArray data_decrypt;
|
||||
data_decrypt = protocol->data_decrypt(data);
|
||||
QJsonDocument json_data = QJsonDocument::fromJson(data_decrypt);
|
||||
QList<QByteArray> list = data_decrypt.split('\n');
|
||||
for (int i = 0; i < list.count(); i++)
|
||||
{
|
||||
QJsonDocument json_data = QJsonDocument::fromJson(list[i]);
|
||||
if (json_data["type"] == "message")
|
||||
{
|
||||
QString data,sendname;
|
||||
QString data, sendname;
|
||||
sendname = json_data["sendname"].toString();
|
||||
data = json_data["data"].toString();
|
||||
emit update_text(sendname,data);
|
||||
emit update_text(sendname, data);
|
||||
qDebug() << "收到message类型的信息" << sendname;
|
||||
}
|
||||
else if (json_data["type"] == "file")
|
||||
{
|
||||
QString filename,file_data,sendname;
|
||||
QString filename, file_data, sendname;
|
||||
sendname = json_data["sendname"].toString();
|
||||
filename = json_data["name"].toString();
|
||||
file_data = json_data["data"].toString();
|
||||
if(json_data["to_user"].toString().isEmpty())
|
||||
if (json_data["to_user"].toString().isEmpty())
|
||||
{
|
||||
emit update_file(sendname,filename,file_data);
|
||||
emit update_file(sendname, filename, file_data);
|
||||
qDebug() << "收到群发的文件" << sendname;
|
||||
}
|
||||
else
|
||||
{
|
||||
emit update_file_private(sendname,filename,file_data);
|
||||
emit update_file_private(sendname, filename, file_data);
|
||||
qDebug() << "收到私发的文件" << sendname;
|
||||
}
|
||||
}
|
||||
|
@ -72,82 +74,101 @@ void DataManager::recv_from_server(QByteArray data)
|
|||
QList<QString> online_users;
|
||||
count = json_data["count"].toInt();
|
||||
online_users = json_data["users"].toVariant().toStringList();
|
||||
emit update_users(count,online_users);
|
||||
emit update_users(count, online_users);
|
||||
qDebug() << "收到更新在线用户列表的信息" << online_users;
|
||||
}
|
||||
else if (json_data["type"] == "response")
|
||||
{
|
||||
if(json_data["action"] == "register")
|
||||
if (json_data["action"] == "register")
|
||||
{
|
||||
bool register_flag;
|
||||
register_flag = json_data["content"].toBool();
|
||||
QJsonObject json = json_data["content"].toObject();
|
||||
QString result = json["result"].toString();
|
||||
if(result == "true")
|
||||
{
|
||||
register_flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
register_flag = false;
|
||||
}
|
||||
emit signup_response(register_flag);
|
||||
qDebug() << "收到服务器响应的注册信息" << register_flag;
|
||||
}
|
||||
else if(json_data["action"] == "signin")
|
||||
else if (json_data["action"] == "signin")
|
||||
{
|
||||
bool signin_flag;
|
||||
signin_flag = json_data["content"].toBool();
|
||||
QJsonObject json = json_data["content"].toObject();
|
||||
QString result = json["result"].toString();
|
||||
if(result == "true")
|
||||
{
|
||||
signin_flag = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
signin_flag = false;
|
||||
}
|
||||
emit signin_response(signin_flag);
|
||||
qDebug() << "收到服务器响应的登录信息" << signin_flag;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "收到未知类型的数据";
|
||||
qDebug() << "收到未知类型的数据" << list[i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DataManager::Register(QString username,QString password)
|
||||
void DataManager::Register(QString username, QString password)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST,QString("register"),QList<QString>{username,password});
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST, QString("register"), QList<QString>{"user", username, "password", password});
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "发送注册信息" <<username <<password;
|
||||
qDebug() << "发送注册信息" << username << password;
|
||||
}
|
||||
|
||||
void DataManager::signin_request(QString username,QString password)
|
||||
void DataManager::signin_request(QString username, QString password)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST,QString("signin"),QList<QString>{username,password});
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST, QString("signin"), QList<QString>{"user", username, "password", password});
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "发送登录信息" <<username <<password;
|
||||
qDebug() << "发送登录信息" << username << password;
|
||||
}
|
||||
|
||||
void DataManager::send_text(QString sendname,QString text)
|
||||
void DataManager::send_text(QString sendname, QString text)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::MESSAGE,sendname,text);
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::MESSAGE, sendname, text);
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "群发文本信息" <<sendname;
|
||||
qDebug() << "群发文本信息" << sendname;
|
||||
}
|
||||
|
||||
void DataManager::send_to_user(QString sendname,QString to_user,QString text)
|
||||
void DataManager::send_to_user(QString sendname, QString to_user, QString text)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::MESSAGE,sendname,to_user,text);
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::MESSAGE, sendname, to_user, text);
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "私发文本信息" << sendname <<to_user;
|
||||
qDebug() << "私发文本信息" << sendname << to_user;
|
||||
}
|
||||
|
||||
void DataManager::send_file_to_all(QString sendname,QString filename,QByteArray file)
|
||||
void DataManager::send_file_to_all(QString sendname, QString filename, QByteArray file)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::FILE,sendname,filename,QString(file));
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::FILE, sendname, filename, QString(file));
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "群发文件" << sendname;
|
||||
}
|
||||
|
||||
void DataManager::send_file_private(QString sendname,QString filename,QByteArray file,QString name)
|
||||
void DataManager::send_file_private(QString sendname, QString filename, QByteArray file, QString name)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::FILE,name,sendname,filename,QString(file));
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::FILE, name, sendname, filename, QString(file));
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "私发文件" << sendname << name;
|
||||
|
@ -155,17 +176,17 @@ void DataManager::send_file_private(QString sendname,QString filename,QByteArray
|
|||
|
||||
void DataManager::account_cancellation(QString username)
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST,QString("cancellation"),username);
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST, QString("cancellation"), QList<QString>{"name",username});
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "发送注销信息" << username;
|
||||
qDebug() << "发送注销信息" << data;
|
||||
}
|
||||
|
||||
void DataManager::update_namelist()
|
||||
{
|
||||
QByteArray data,data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST,QString("update_namelist"));
|
||||
QByteArray data, data_encrypt;
|
||||
data = protocol->data_maker(Protocol::REQUEST, QString("update_namelist"));
|
||||
data_encrypt = protocol->data_encrypt(data);
|
||||
tcpclient->sendToserver(data_encrypt);
|
||||
qDebug() << "发送更新在线用户列表信息";
|
||||
|
|
|
@ -170,7 +170,7 @@ void Login::signin_response(bool result)
|
|||
connect(mainwidget,&MainWidget::send_to_user,datamanager,&DataManager::send_to_user);
|
||||
connect(mainwidget,&MainWidget::send_file_private,datamanager,&DataManager::send_file_private);
|
||||
connect(mainwidget,&MainWidget::send_file_to_all,datamanager,&DataManager::send_file_to_all);
|
||||
connect(mainwidget,&MainWidget::exit_client,datamanager,&DataManager::update_namelist);
|
||||
//connect(mainwidget,&MainWidget::exit_client,datamanager,&DataManager::update_namelist);
|
||||
connect(mainwidget,&MainWidget::account_cancellation,datamanager,&DataManager::account_cancellation);
|
||||
connect(datamanager,&DataManager::update_text,mainwidget,&MainWidget::update_text);
|
||||
connect(datamanager,&DataManager::update_file,mainwidget,&MainWidget::update_file);
|
||||
|
@ -193,6 +193,9 @@ void Login::signup_response(bool result)
|
|||
{
|
||||
QString information = QString("请妥善保存您的用户名和密码!");
|
||||
QMessageBox::information(signup,tr("注册成功"),information);
|
||||
signup->close();
|
||||
this->show();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
24
login.ui
24
login.ui
|
@ -30,14 +30,18 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
||||
<string notr="true">QPushButton
|
||||
{background-color:qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
||||
stop:1 rgba(64, 145, 252, 255),
|
||||
stop:0 rgba(220, 255, 255, 255));
|
||||
color: rgb(255, 255, 255);
|
||||
border:0px groove gray;
|
||||
border-radius:7px;
|
||||
padding:2px 4px;
|
||||
font: 14pt "Candara";}
|
||||
|
||||
border:0px groove gray;border-radius:
|
||||
7px;padding:2px 4px;
|
||||
font: 14pt "Candara";</string>
|
||||
QPushButton:hover
|
||||
{background-color:#999999;}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sign in</string>
|
||||
|
@ -84,14 +88,18 @@ font: 12pt "Candara";</string>
|
|||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
||||
<string notr="true">QPushButton
|
||||
{background-color:qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,
|
||||
stop:1 rgba(64, 145, 252, 255),
|
||||
stop:0 rgba(220, 255, 255, 255));
|
||||
color: rgb(255, 255, 255);
|
||||
border:0px groove gray;
|
||||
border-radius:7px;
|
||||
padding:2px 4px;
|
||||
font: 14pt "Candara";}
|
||||
|
||||
border:0px groove gray;border-radius:
|
||||
7px;padding:2px 4px;
|
||||
font: 14pt "Candara";</string>
|
||||
QPushButton:hover
|
||||
{background-color:#999999;}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sign up</string>
|
||||
|
|
|
@ -39,42 +39,37 @@ void MainWidget::on_send_text_clicked()
|
|||
if (reply == QMessageBox::No)
|
||||
return;
|
||||
else
|
||||
{
|
||||
QString text = ui->msg_edit->text();
|
||||
if(text.isEmpty()) //群发
|
||||
{
|
||||
QString currentTime = QTime::currentTime().toString("H:mm A");
|
||||
ui->textEdit->append("<font color=\"MediumBlue\"><b>" + username + " [" + currentTime + "] send a file \"" + filename + "\"</b></font>");
|
||||
|
||||
QString name = ui->msg_edit->text();
|
||||
if(name.isEmpty()) //群发
|
||||
{
|
||||
this->sendFile(filePath,filename);
|
||||
}
|
||||
else //私发文件
|
||||
{
|
||||
ui->msg_edit->clear();
|
||||
int n = text.indexOf(' ');
|
||||
QString name = text.mid(1,n-1);
|
||||
if(name == username)
|
||||
{
|
||||
QMessageBox::critical(this,"错误","不能自己给自己发送文件!");
|
||||
}
|
||||
else
|
||||
{
|
||||
QString currentTime = QTime::currentTime().toString("H:mm A");
|
||||
ui->textEdit->append(QString("<font color=\"MediumBlue\"><b>" + username + " [" + currentTime + "] send a private file to %1\""
|
||||
+ filename + "\"</b></font>").arg(name));
|
||||
this->sendFile(filePath,filename,name);
|
||||
}
|
||||
QProgressDialog *progressDlg = new QProgressDialog(this);
|
||||
progressDlg->setWindowModality(Qt::WindowModal);
|
||||
progressDlg->setMinimumDuration(0);
|
||||
progressDlg->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
progressDlg->setWindowTitle(tr("上传文件"));
|
||||
progressDlg->setLabelText(tr("正在上传......"));
|
||||
progressDlg->setCancelButtonText(tr("取消"));
|
||||
progressDlg->setRange(0, 8000);
|
||||
for (int i = 1; i < 8000; i++)
|
||||
{
|
||||
progressDlg->setValue(i);
|
||||
if (progressDlg->wasCanceled())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
progressDlg->close();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWidget::on_save_btn_clicked()
|
||||
{
|
||||
QFile file("memory.txt");
|
||||
QFile file("./txt/memory.txt");
|
||||
if (file.exists()) //文件存在
|
||||
{
|
||||
QMessageBox::StandardButton reply;
|
||||
|
@ -125,18 +120,30 @@ void MainWidget::on_send_btn_clicked()
|
|||
return;
|
||||
}
|
||||
ui->msg_edit->clear();
|
||||
QString currentTime = QTime::currentTime().toString("H:m A");
|
||||
ui->textEdit->append("<font color=\"MediumBlue\"><b>" + username + " [" + currentTime + "] :</b> " + text + "</font>");
|
||||
|
||||
if(text[0] == '@')
|
||||
{
|
||||
int n = text.indexOf(' ');
|
||||
QString to_user = text.mid(1,n-1);
|
||||
QString insert = "tell you quietly:";
|
||||
text = insert + text.mid(n,-1);
|
||||
emit send_to_user(username,to_user,text);
|
||||
QString data_text = insert + text.mid(n,-1);
|
||||
QString text_self = QString("私发给%1:%2").arg(to_user).arg(text.mid(n));
|
||||
qDebug() << text_self;
|
||||
if(to_user == username)
|
||||
{
|
||||
QMessageBox::critical(this,"错误","不能自己给自己发送消息!");
|
||||
}
|
||||
else
|
||||
{
|
||||
QString currentTime = QTime::currentTime().toString("H:m A");
|
||||
ui->textEdit->append("<font color=\"MediumBlue\"><b>" + username + " [" + currentTime + "] :</b> " + text_self + "</font>");
|
||||
emit send_to_user(username,to_user,data_text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
QString currentTime = QTime::currentTime().toString("H:m A");
|
||||
ui->textEdit->append("<font color=\"MediumBlue\"><b>" + username + " [" + currentTime + "] :</b> " + text + "</font>");
|
||||
emit send_text(username,text);
|
||||
}
|
||||
}
|
||||
|
@ -168,7 +175,6 @@ void MainWidget::on_exit_btn_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::on_stop_clicked()
|
||||
{
|
||||
QMessageBox::StandardButton response;
|
||||
|
@ -176,6 +182,7 @@ void MainWidget::on_stop_clicked()
|
|||
|
||||
if(response == QMessageBox::Yes)
|
||||
{
|
||||
qDebug() << "点击注销账户按钮";
|
||||
emit exit_client();
|
||||
emit account_cancellation(username);
|
||||
this->close();
|
||||
|
@ -200,10 +207,11 @@ void MainWidget::update_file(QString sendname,QString filename,QString file_data
|
|||
if(response == QMessageBox::Yes)
|
||||
{
|
||||
readFile(filename,file_data.toUtf8());
|
||||
response = QMessageBox::question(this,"接收文件","接收成功!");
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::information(this,"消息","未接收该文件!");
|
||||
QMessageBox::information(this,"接收文件","未接收该文件!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,6 +269,27 @@ void MainWidget::sendFile(QString filePath,QString filename,QString name)
|
|||
QMessageBox::warning(this,"错误","无法打开文件!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
QProgressDialog *progressDlg = new QProgressDialog(this);
|
||||
progressDlg->setWindowModality(Qt::WindowModal);
|
||||
progressDlg->setMinimumDuration(0);
|
||||
progressDlg->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
progressDlg->setWindowTitle(tr("上传文件"));
|
||||
progressDlg->setLabelText(tr("正在上传......"));
|
||||
progressDlg->setCancelButtonText(tr("取消"));
|
||||
progressDlg->setRange(0, 12000);
|
||||
for (int i = 1; i < 12000; i++)
|
||||
{
|
||||
progressDlg->setValue(i);
|
||||
if (progressDlg->wasCanceled())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
progressDlg->close();
|
||||
QMessageBox::information(this,"发送文件","发送成功!");
|
||||
}
|
||||
//打开文件流,以写的方式打开
|
||||
QDataStream out(&block,QIODevice::WriteOnly);
|
||||
out.setVersion(QDataStream::Qt_5_8);
|
||||
|
|
Loading…
Reference in New Issue