From e8478b1cf784a048f11eaf1482de559a80113c64 Mon Sep 17 00:00:00 2001 From: 487 <2195436316@qq.com> Date: Tue, 27 Dec 2022 18:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LibManagementSystem/book_info.cpp | 2 +- LibManagementSystem/borrow.cpp | 2 +- LibManagementSystem/communication_module.cpp | 2 +- LibManagementSystem/login.cpp | 4 ++-- LibManagementSystem/mainwindow.cpp | 4 ++-- LibManagementSystem/mainwindow.h | 2 +- LibManagementSystem/search.cpp | 5 +++-- LibManagementSystem/search.h | 1 + 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/LibManagementSystem/book_info.cpp b/LibManagementSystem/book_info.cpp index c65110e..3218563 100644 --- a/LibManagementSystem/book_info.cpp +++ b/LibManagementSystem/book_info.cpp @@ -75,6 +75,7 @@ void book_info::processb(int r) void book_info::on_pushButton_clicked() { +// emit ifborcon(); if(user->account=="") { QMessageBox* box = new QMessageBox(this); @@ -127,7 +128,6 @@ void book_info::fail_infobor(QString failmsg) void book_info::receive_infobor() { - emit recon(); QMessageBox* box = new QMessageBox(this); box->setIcon(QMessageBox::Information); box->setWindowTitle("提示"); diff --git a/LibManagementSystem/borrow.cpp b/LibManagementSystem/borrow.cpp index 4865570..e7a95b5 100644 --- a/LibManagementSystem/borrow.cpp +++ b/LibManagementSystem/borrow.cpp @@ -60,7 +60,7 @@ void borrow::on_enter_btn_clicked() ,QMessageBox::Yes|QMessageBox::No); switch(re){ case QMessageBox::Yes: - emit send_app(msg); + emit send_enter(msg); if(match.indexIn(user->message) != -1){ user->message = ""; } diff --git a/LibManagementSystem/communication_module.cpp b/LibManagementSystem/communication_module.cpp index 3f7cca1..fcfac9f 100644 --- a/LibManagementSystem/communication_module.cpp +++ b/LibManagementSystem/communication_module.cpp @@ -17,7 +17,7 @@ communication_module::~communication_module() //准备连接服务器 void communication_module::sendmsgPreparation(QByteArray msg) { -// qDebug() << "发送信号"; + qDebug() << "发送信号"; if(!has_msg_sent) msg_tobe_sent=msg; if(socket==nullptr){ diff --git a/LibManagementSystem/login.cpp b/LibManagementSystem/login.cpp index 00b952a..a2404cc 100644 --- a/LibManagementSystem/login.cpp +++ b/LibManagementSystem/login.cpp @@ -57,7 +57,7 @@ void login::fail_login(QString failmsg) box->setText(failmsg); box->show(); box->setAttribute(Qt::WA_DeleteOnClose); -// qDebug() << "登陆失败"; + qDebug() << "登陆失败"; } void login::receive_login() @@ -65,7 +65,7 @@ void login::receive_login() ui->accountlineEdit->clear(); ui->passwordlineEdit->clear(); emit open_main(); -// qDebug() << "登陆成功"; + qDebug() << "登陆成功"; } void login::fail_regis(QString failmsg) diff --git a/LibManagementSystem/mainwindow.cpp b/LibManagementSystem/mainwindow.cpp index 1227824..47497ce 100644 --- a/LibManagementSystem/mainwindow.cpp +++ b/LibManagementSystem/mainwindow.cpp @@ -228,6 +228,7 @@ void MainWindow::searchC() connect(client,&communication_module::pic_received,sea,&search::picture_received); connect(client,&communication_module::process_update,sea,&search::process); connect(sea,&search::nw,this,&MainWindow::rw); + connect(sea,&search::disW,this,&MainWindow::disW); } void MainWindow::rw() { @@ -276,7 +277,6 @@ void MainWindow::loncon() void MainWindow::ifborcon() { disconnectAll(); - disW(); connect(sea->w,&book_info::send_bkif,client,&communication_module::sendmsgPreparation); connect(client,&communication_module::sendfail,sea->w,&book_info::fail_infobor); connect(client,&communication_module::msg_received,sea->w,&book_info::receive_infobor); @@ -286,12 +286,12 @@ void MainWindow::ifborcon() void MainWindow::ifappcon() { disconnectAll(); - disW(); connect(sea->w,&book_info::send_bkif,client,&communication_module::sendmsgPreparation); connect(client,&communication_module::sendfail,sea->w,&book_info::fail_infoapp); connect(client,&communication_module::msg_received,sea->w,&book_info::receive_infoapp); connect(sea->w,&book_info::ifborcon,this,&MainWindow::ifborcon); connect(sea->w,&book_info::ifappcon,this,&MainWindow::ifappcon); + connect(sea,&search::nw,this,&MainWindow::rw); } void MainWindow::user_infoC() diff --git a/LibManagementSystem/mainwindow.h b/LibManagementSystem/mainwindow.h index 704dbde..72e08c2 100644 --- a/LibManagementSystem/mainwindow.h +++ b/LibManagementSystem/mainwindow.h @@ -36,7 +36,6 @@ public: void returnC(); void user_infoC(); void disconnectAll(); - void disW(); ~MainWindow(); signals: @@ -46,6 +45,7 @@ public slots: void ifborcon(); void ifappcon(); void rw(); + void disW(); void searchcon(); void borrowcon(); void appcon(); diff --git a/LibManagementSystem/search.cpp b/LibManagementSystem/search.cpp index bc1bc5a..2120519 100644 --- a/LibManagementSystem/search.cpp +++ b/LibManagementSystem/search.cpp @@ -44,12 +44,13 @@ void search::infoClicked(const QModelIndex &u) else emit picture_received(); w->setWindowTitle("书籍详细信息"); w->exec(); - + emit w->recon(); + emit disW(); disconnect(this,&search::picture_received,w,&book_info::picture_get); disconnect(this,&search::picture_fail,w,&book_info::picture_fail); disconnect(w,&book_info::send_pic,this,&search::send); disconnect(this,&search::process,w,&book_info::processb); - w->setAttribute(Qt::WA_DeleteOnClose); + delete w; } search::~search() { diff --git a/LibManagementSystem/search.h b/LibManagementSystem/search.h index 56926d8..15ec12d 100644 --- a/LibManagementSystem/search.h +++ b/LibManagementSystem/search.h @@ -38,6 +38,7 @@ private: signals: void send(QByteArray); void nw(); + void disW(); void open_main(); void open_login(); void open_user_info(); -- Gitee