From b70f2b2a697b7483c2dd24a5e1ddd184b8c1fa84 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 13 Aug 2018 14:27:58 +0200 Subject: [PATCH] Fix Ctrl+n shortcut in locator widget in some configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/plugins/coreplugin/locator/locatorwidget.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 55be82072ab..f15f645b7bb 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -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);