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: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2013-08-21 23:21:13 +03:00
committed by Orgad Shaneh
parent fc52103524
commit 8f470b0512
2 changed files with 7 additions and 2 deletions

View File

@@ -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) {

View File

@@ -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: