diff --git a/LibManagementSystem/borrow.cpp b/LibManagementSystem/borrow.cpp index 8971e7acaa44a60de9fb5f5cb7e3e995dd9ac040..92576f44b16826db8fb48c23405af01e808d3e09 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 ed22b6f72f4fcdc52e047bd97aca512e5175e4cd..ac30b498d2c92121e340c59a6fe2cb481b10f1e0 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 870b309ff998d5ce6154220e6da46130b7658bdd..32dacee285f89edaf7c3ea6c6cb04099c40c4cc8 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 f0da217b48e34d7babe4d31c70d5226f80d27877..413ab0f4af577c6ec9c07d5ab44fe65b2b6a2c53 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);