From 8e41b589698b1d6658f8f801b0057a8abd37d731 Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Wed, 24 Aug 2022 09:57:07 +0800 Subject: [PATCH 1/2] Fix: the result widget dont hide while stopping search. --- frontend/mainwindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/mainwindow.cpp b/frontend/mainwindow.cpp index 283d3e2..b4776a8 100644 --- a/frontend/mainwindow.cpp +++ b/frontend/mainwindow.cpp @@ -301,10 +301,12 @@ void MainWindow::searchKeywordSlot(const QString &keyword) //NEW_TODO if(keyword == "") { // m_stackedWidget->setPage(int(StackedPage::HomePage)); - m_askTimer->stop(); - Q_EMIT m_searchResultPage->stopSearch(); - m_searchResultPage->hide(); - this->resizeHeight(68); + QTimer::singleShot(10, this, [ = ]() { + m_askTimer->stop(); + Q_EMIT m_searchResultPage->stopSearch(); + m_searchResultPage->hide(); + this->resizeHeight(68); + }); } else { // m_stackedWidget->setPage(int(StackedPage::SearchPage)); From c2a5051b5d72a11f44774320b4adeb09895773da Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Wed, 24 Aug 2022 10:34:00 +0800 Subject: [PATCH 2/2] Fix the problem that the result widget will display a blank page. --- frontend/mainwindow.cpp | 2 +- frontend/model/search-result-manager.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/mainwindow.cpp b/frontend/mainwindow.cpp index b4776a8..7792535 100644 --- a/frontend/mainwindow.cpp +++ b/frontend/mainwindow.cpp @@ -303,7 +303,7 @@ void MainWindow::searchKeywordSlot(const QString &keyword) // m_stackedWidget->setPage(int(StackedPage::HomePage)); QTimer::singleShot(10, this, [ = ]() { m_askTimer->stop(); - Q_EMIT m_searchResultPage->stopSearch(); +// Q_EMIT m_searchResultPage->stopSearch(); m_searchResultPage->hide(); this->resizeHeight(68); }); diff --git a/frontend/model/search-result-manager.cpp b/frontend/model/search-result-manager.cpp index 1ac4a63..91179f2 100644 --- a/frontend/model/search-result-manager.cpp +++ b/frontend/model/search-result-manager.cpp @@ -67,6 +67,7 @@ ReceiveResultThread::ReceiveResultThread(DataQueuerequestInterruption(); + this->wait(); this->quit(); }