Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create the first searching node after pressing the enter key #1452

Merged
merged 11 commits into from
Oct 7, 2023
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
Loading