Close result widgets with escape button

For #86
This commit is contained in:
Gres 2022-03-27 11:37:32 +03:00
parent 4f195f5629
commit 260a10bea3

View File

@ -135,6 +135,10 @@ bool Representer::eventFilter(QObject * /*watched*/, QEvent *event)
const auto casted = static_cast<QMouseEvent *>(event); const auto casted = static_cast<QMouseEvent *>(event);
if (casted->button() == Qt::LeftButton) if (casted->button() == Qt::LeftButton)
hide(); hide();
} else if (event->type() == QEvent::KeyPress) {
const auto casted = static_cast<QKeyEvent *>(event);
if (casted->key() == Qt::Key_Escape)
hide();
} }
return false; return false;
} }