From f0dc5ed51da9f772102667a8d633b283a5c12c34 Mon Sep 17 00:00:00 2001 From: 487 <2195436316@qq.com> Date: Mon, 12 Dec 2022 18:55:12 +0800 Subject: [PATCH] w --- LibManagementSystem/borrow.cpp | 4 +++- LibManagementSystem/login.cpp | 6 +++++- LibManagementSystem/regis.cpp | 12 ++++++++++-- LibManagementSystem/search.cpp | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/LibManagementSystem/borrow.cpp b/LibManagementSystem/borrow.cpp index 8971e7a..92576f4 100644 --- a/LibManagementSystem/borrow.cpp +++ b/LibManagementSystem/borrow.cpp @@ -19,7 +19,7 @@ borrow::~borrow() void borrow::on_enter_btn_clicked() { QByteArray msg; - char t = (char)130; + char t = '^'; msg += "BORROW" + ui->no_edit->text().toStdString() + t + "dj21311256"; emit send(msg); } @@ -31,6 +31,7 @@ void borrow::fail(QString failmsg) box->setWindowTitle("借书失败"); box->setText(failmsg); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); } void borrow::receive() @@ -40,6 +41,7 @@ void borrow::receive() box->setWindowTitle("提示"); box->setText("借书成功!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); } void borrow::on_return_btn_clicked() diff --git a/LibManagementSystem/login.cpp b/LibManagementSystem/login.cpp index ed22b6f..ac30b49 100644 --- a/LibManagementSystem/login.cpp +++ b/LibManagementSystem/login.cpp @@ -25,7 +25,7 @@ login::~login() void login::on_loginBtn_clicked() { QByteArray msg; - char t = (char)130; + char t = '^'; msg += "ACCONT2" + ui->accountlineEdit->text().trimmed().toStdString() + t + ui->passwordlabel->text().trimmed().toStdString(); emit send_login(msg); } @@ -50,6 +50,7 @@ void login::fail_login(QString failmsg) box->setWindowTitle("登陆失败"); box->setText(failmsg); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); } void login::receive_login() @@ -59,6 +60,7 @@ void login::receive_login() box->setWindowTitle("提示"); box->setText("登陆成功!点击OK返回主页面!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); emit open_main(); } @@ -69,6 +71,7 @@ void login::fail_regis(QString failmsg) box->setWindowTitle("注册失败"); box->setText(failmsg); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); } void login::receive_regis() @@ -79,6 +82,7 @@ void login::receive_regis() box->setWindowTitle("提示"); box->setText("注册成功!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); } void login::on_registerBtn_clicked() diff --git a/LibManagementSystem/regis.cpp b/LibManagementSystem/regis.cpp index 870b309..32dacee 100644 --- a/LibManagementSystem/regis.cpp +++ b/LibManagementSystem/regis.cpp @@ -55,6 +55,7 @@ void regis::on_confirm_clicked() box->setWindowTitle("注册失败"); box->setText("还有信息未填写!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); return; } if(phone.size() < 11 ){ @@ -63,6 +64,7 @@ void regis::on_confirm_clicked() box->setWindowTitle("注册失败"); box->setText("电话号码格式不正确!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); return; } int is_at; @@ -73,6 +75,7 @@ void regis::on_confirm_clicked() box->setWindowTitle("注册失败"); box->setText("邮箱格式不正确!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); return; } if(firstpas.size() < 6){ @@ -81,6 +84,7 @@ void regis::on_confirm_clicked() box->setWindowTitle("注册失败"); box->setText("密码长度过短,请设置至少6位!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); return; } if(firstpas != secondpas){ @@ -89,12 +93,14 @@ void regis::on_confirm_clicked() box->setWindowTitle("注册失败"); box->setText("两次输入密码不一致!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); return; } QByteArray msg; - msg+= "ACCONT1" + acc.toStdString() + char(130) + nick.toStdString() + char(130) + secondpas.toStdString() + char(130) - + sex.toStdString() + char(130) + phone.toStdString() + char(130) + mail.toStdString(); + char t = '^'; + msg+= "ACCONT1" + acc.toStdString() + t + nick.toStdString() + t + secondpas.toStdString() + t + + sex.toStdString() + t + phone.toStdString() + t + mail.toStdString(); emit confirm(msg); } @@ -105,6 +111,7 @@ void regis::fail(QString failmsg) box->setWindowTitle("注册失败"); box->setText(failmsg); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); } void regis::receive() @@ -114,6 +121,7 @@ void regis::receive() box->setWindowTitle("提示"); box->setText("注册成功!"); box->show(); + box->setAttribute(Qt::WA_DeleteOnClose); this->close(); } diff --git a/LibManagementSystem/search.cpp b/LibManagementSystem/search.cpp index f0da217..413ab0f 100644 --- a/LibManagementSystem/search.cpp +++ b/LibManagementSystem/search.cpp @@ -53,7 +53,7 @@ void search::on_search_2_clicked() QString a=ui->bname->text(); QString b=ui->bauthor->text(); QString c=ui->bpress->text(); - char t = (char)130; + char t = '^'; QByteArray m; m+="SEARCH"+a.toStdString()+t+b.toStdString()+t+c.toStdString()+t+d.toStdString(); emit send(m); -- Gitee