From 03e35aac14c8ee2d9531297b658b4106b11c303b Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 20 Jun 2024 10:01:18 +0200 Subject: [PATCH] Core: Fix selecting recent document with arrow keys The editor actions are defined in the editor since the removal of the TextEditorActionHandler. So we potentially capture the ctrl+up/down in the editor. Fix this by overwriting the shortcuts in the event handler of the open editor widget. Fixes: QTCREATORBUG-31072 Change-Id: I45217962bcb2ef3ae8ebed7c4a6d0412bcc0216b Reviewed-by: Eike Ziller --- .../coreplugin/editormanager/openeditorswindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index d59f49bf803..606f6b0f683 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -161,6 +161,17 @@ void OpenEditorsWindow::setVisible(bool visible) bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e) { if (obj == m_editorView) { + if (e->type() == QEvent::ShortcutOverride) { + auto ke = static_cast(e); + if (ke->key() == Qt::Key_Up) { + selectPreviousEditor(); + return true; + } + if (ke->key() == Qt::Key_Down) { + selectNextEditor(); + return true; + } + } if (e->type() == QEvent::KeyPress) { auto ke = static_cast(e); if (ke->key() == Qt::Key_Escape) {