Fix ENTER press state;

This commit is contained in:
jixiaoxu 2021-09-13 20:12:35 +08:00
parent 617e73f577
commit 23540d8f05
2 changed files with 5 additions and 4 deletions

View File

@ -521,9 +521,11 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
if (event->key() == Qt::Key_Escape) { if (event->key() == Qt::Key_Escape) {
tryHideMainwindow(); tryHideMainwindow();
} else if (event->key() == Qt::Key_Return or event->key() == Qt::Key_Enter) { } else if (event->key() == Qt::Key_Return or event->key() == Qt::Key_Enter) {
if (!m_searchResultPage->isHidden()) {
//显示最佳匹配中第一项的详情页,无搜索结果则调取网页搜索 //显示最佳匹配中第一项的详情页,无搜索结果则调取网页搜索
qDebug() << "Press Enter"; qDebug() << "Press Enter";
m_searchResultPage->pressEnter(); m_searchResultPage->pressEnter();
}
} else if (event->key() == Qt::Key_Up) { } else if (event->key() == Qt::Key_Up) {
qDebug() << "Press ↑"; qDebug() << "Press ↑";
m_searchResultPage->pressUp(); m_searchResultPage->pressUp();

View File

@ -56,7 +56,6 @@ Q_SIGNALS:
void listLengthChanged(const int &); void listLengthChanged(const int &);
void rowClicked(); void rowClicked();
void lableReset(); void lableReset();
void mouseSelect(QModelIndex &index);
}; };
class ResultWidget : public QWidget class ResultWidget : public QWidget