Skip to content

Commit

Permalink
Merge pull request #1452 from 1445643474/master
Browse files Browse the repository at this point in the history
create the first searching node after pressing the enter key
  • Loading branch information
zhouhang95 authored Oct 7, 2023
2 parents b4b92b1 + 60ab533 commit 7c33474
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/zenoedit/nodesys/searchview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ void SearchResultWidget::resizeCount(int count)

void SearchResultWidget::moveToTop()
{
setCurrentIndex(model()->index(0, 0));
clearSelection();
setCurrentIndex(model()->index(0, 0));
}

void SearchResultWidget::keyPressEvent(QKeyEvent* event)
Expand Down
7 changes: 7 additions & 0 deletions ui/zenoedit/nodesys/zenonewmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ bool ZenoNewnodeMenu::eventFilter(QObject* watched, QEvent* event)
return true;
}
}
else if (watched == m_searchEdit && (pKeyEvent->key() == Qt::Key_Return || pKeyEvent->key() == Qt::Key_Enter))
{
if (m_searchView->isVisible() && m_searchView->count() > 0)
{
emit m_searchView->pressed(m_searchView->currentIndex());
}
}
}
else if (watched == m_searchEdit && event->type() == QEvent::Show)
{
Expand Down

0 comments on commit 7c33474

Please sign in to comment.