diff --git a/frontend/mainwindow.cpp b/frontend/mainwindow.cpp index 75487af..7f63474 100644 --- a/frontend/mainwindow.cpp +++ b/frontend/mainwindow.cpp @@ -173,6 +173,9 @@ void MainWindow::bootOptionsFilter(QString opt) { clearSearchResult(); centerToScreen(this); this->m_searchBarWidget->setFocus(); + QTimer::singleShot(0, [&](){ + QGuiApplication::inputMethod()->show(); + }); } this->activateWindow(); this->raise(); @@ -187,25 +190,6 @@ void MainWindow::clearSearchResult() { // m_searchLineEdit->clearFocus(); } -/** - * @brief MainWindow::trayIconActivatedSlot 点击任务栏图标的槽函数 - * @param reason - */ -void MainWindow::trayIconActivatedSlot(QSystemTrayIcon::ActivationReason reason) -{ - if(reason == QSystemTrayIcon::Trigger) { - if(!this->isVisible()) { - clearSearchResult(); - centerToScreen(this); -// this->m_searchLineEdit->focusIn(); //打开主界面时输入框夺焦,可直接输入 - this->activateWindow(); - this->raise(); - } else { - tryHideMainwindow(); - } - } -} - /** * @brief setSearchMethodConfig 在询问弹窗点击按钮后执行 * @param create_index 是否同意创建索引 diff --git a/frontend/mainwindow.h b/frontend/mainwindow.h index 3a5a4d4..1aaa4ce 100644 --- a/frontend/mainwindow.h +++ b/frontend/mainwindow.h @@ -86,7 +86,6 @@ public Q_SLOTS: void ScreenGeometryChanged(QRect rect); void bootOptionsFilter(QString opt); // 过滤终端命令 void clearSearchResult(); //清空搜索结果 - void trayIconActivatedSlot(QSystemTrayIcon::ActivationReason reason); void searchKeywordSlot(const QString&); void resizeHeight(int height); void tryHide();