feat(frontend):搜索框显示时请求显示虚拟键盘
This commit is contained in:
parent
d41c137530
commit
e107ea3e07
|
@ -173,6 +173,9 @@ void MainWindow::bootOptionsFilter(QString opt) {
|
||||||
clearSearchResult();
|
clearSearchResult();
|
||||||
centerToScreen(this);
|
centerToScreen(this);
|
||||||
this->m_searchBarWidget->setFocus();
|
this->m_searchBarWidget->setFocus();
|
||||||
|
QTimer::singleShot(0, [&](){
|
||||||
|
QGuiApplication::inputMethod()->show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
this->activateWindow();
|
this->activateWindow();
|
||||||
this->raise();
|
this->raise();
|
||||||
|
@ -187,25 +190,6 @@ void MainWindow::clearSearchResult() {
|
||||||
// m_searchLineEdit->clearFocus();
|
// 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 在询问弹窗点击按钮后执行
|
* @brief setSearchMethodConfig 在询问弹窗点击按钮后执行
|
||||||
* @param create_index 是否同意创建索引
|
* @param create_index 是否同意创建索引
|
||||||
|
|
|
@ -86,7 +86,6 @@ public Q_SLOTS:
|
||||||
void ScreenGeometryChanged(QRect rect);
|
void ScreenGeometryChanged(QRect rect);
|
||||||
void bootOptionsFilter(QString opt); // 过滤终端命令
|
void bootOptionsFilter(QString opt); // 过滤终端命令
|
||||||
void clearSearchResult(); //清空搜索结果
|
void clearSearchResult(); //清空搜索结果
|
||||||
void trayIconActivatedSlot(QSystemTrayIcon::ActivationReason reason);
|
|
||||||
void searchKeywordSlot(const QString&);
|
void searchKeywordSlot(const QString&);
|
||||||
void resizeHeight(int height);
|
void resizeHeight(int height);
|
||||||
void tryHide();
|
void tryHide();
|
||||||
|
|
Loading…
Reference in New Issue