Fix Ctrl+n shortcut in locator widget in some configurations

With Gnome, Qt seems to send shortcut override events to the
CompletionList, and not to the input field, so handle
the shortcut override for Ctrl+N/P there too.
Technically this is the correct thing to do anyhow, since
CompletionList also handles the corresponding key press events.

Task-number: QTCREATORBUG-20867
Change-Id: Ia72aae3b085140f18b0f1007991d38864dfe8426
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Eike Ziller
2018-08-13 14:27:58 +02:00
parent 16803bf9ec
commit b70f2b2a69

View File

@@ -514,6 +514,13 @@ bool CompletionList::eventFilter(QObject *watched, QEvent *event)
return true;
}
break;
case Qt::Key_P:
case Qt::Key_N:
if (ke->modifiers() == Qt::KeyboardModifiers(Utils::HostOsInfo::controlModifier())) {
event->accept();
return true;
}
break;
}
}
return Utils::TreeView::eventFilter(watched, event);