Commit 8f470b05 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

ProposalWidgets: Accept escape key event



Otherwise it is passed on to other widgets (like the Find toolbar)

Task-number: QTCREATORBUG-5748
Change-Id: I3e7fe19327d2b3d15c9c9f84360b936dc4698dfd
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent fc521035
......@@ -190,12 +190,16 @@ bool FunctionHintProposalWidget::eventFilter(QObject *obj, QEvent *e)
{
switch (e->type()) {
case QEvent::ShortcutOverride:
if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape)
if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape) {
d->m_escapePressed = true;
e->accept();
}
break;
case QEvent::KeyPress:
if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape)
if (static_cast<QKeyEvent*>(e)->key() == Qt::Key_Escape) {
d->m_escapePressed = true;
e->accept();
}
if (d->m_model->size() > 1) {
QKeyEvent *ke = static_cast<QKeyEvent*>(e);
if (ke->key() == Qt::Key_Up) {
......
......@@ -571,6 +571,7 @@ bool GenericProposalWidget::eventFilter(QObject *o, QEvent *e)
switch (ke->key()) {
case Qt::Key_Escape:
abort();
e->accept();
return true;
case Qt::Key_N:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment