diff --git a/LibManagementSystem/book_info.cpp b/LibManagementSystem/book_info.cpp index c65110eb1c998eeba0daabab1d4a8f7ddc94f23b..3218563beb412287b057adc3c469c33ca1bf2e34 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 48655704a2e75a6d7e9976495068f1628153aea4..e7a95b52779d370efe6c5cfb6a18105315489681 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 3f7cca17833437118552fbaf23226bdd6309cf94..fcfac9fd093c2c31b6475e6fcb0eb1d796970d54 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 00b952abfb178b26186d1888447ea28aa79c32bd..a2404cc29be8a0eec7ab6e1d7dbdb1cbfb9986d7 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 12278248a70f537bb0465c61f95efa6f0ab887e5..47497ce60ced738ebe51157b23298837b04bb5e3 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 704dbde8c0d925892cb153c90bf96f5848036fdf..72e08c25dd4586601ec063ba3e782017c1c85912 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 bc1bc5af2bc2010ac660c808ea585e7af2212eaa..212051942a5040d092e5d3d1814ceaa268c94f79 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 56926d8e87adfa66fbdbd63b1d6abe195353c072..15ec12d6cfd49290f1a8e26f6c116e0ebf60d8c4 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();