forked from qt-creator/qt-creator
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 <eike.ziller@qt.io>
This commit is contained in:
@@ -161,6 +161,17 @@ void OpenEditorsWindow::setVisible(bool visible)
|
|||||||
bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e)
|
bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e)
|
||||||
{
|
{
|
||||||
if (obj == m_editorView) {
|
if (obj == m_editorView) {
|
||||||
|
if (e->type() == QEvent::ShortcutOverride) {
|
||||||
|
auto ke = static_cast<QKeyEvent*>(e);
|
||||||
|
if (ke->key() == Qt::Key_Up) {
|
||||||
|
selectPreviousEditor();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (ke->key() == Qt::Key_Down) {
|
||||||
|
selectNextEditor();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (e->type() == QEvent::KeyPress) {
|
if (e->type() == QEvent::KeyPress) {
|
||||||
auto ke = static_cast<QKeyEvent*>(e);
|
auto ke = static_cast<QKeyEvent*>(e);
|
||||||
if (ke->key() == Qt::Key_Escape) {
|
if (ke->key() == Qt::Key_Escape) {
|
||||||
|
Reference in New Issue
Block a user