From e40329b85a4eaa13aa0b733870ba23b327bd6f11 Mon Sep 17 00:00:00 2001 From: Sam Aaron Date: Mon, 21 Oct 2024 11:07:14 +0100 Subject: [PATCH] GUI - reduce scope of text editor copy shortcuts (on Windows these appear to override the shortcuts in the menubar) --- app/gui/qt/mainwindow.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/gui/qt/mainwindow.cpp b/app/gui/qt/mainwindow.cpp index 1b45686b64..d883307d3f 100644 --- a/app/gui/qt/mainwindow.cpp +++ b/app/gui/qt/mainwindow.cpp @@ -4674,13 +4674,20 @@ void MainWindow::setUpdateInfoText(QString t) void MainWindow::addUniversalCopyShortcuts(QTextEdit* te) { - new QShortcut(ctrlKey("c"), te, SLOT(copy())); - new QShortcut(ctrlKey("a"), te, SLOT(selectAll())); + QShortcut* copyShortcutCtrl = new QShortcut(ctrlKey("c"), te, SLOT(copy())); + copyShortcutCtrl->setContext(Qt::WidgetShortcut); - new QShortcut(metaKey("c"), te, SLOT(copy())); - new QShortcut(metaKey("a"), te, SLOT(selectAll())); + QShortcut* selectAllShortcutCtrl = new QShortcut(ctrlKey("a"), te, SLOT(selectAll())); + selectAllShortcutCtrl->setContext(Qt::WidgetShortcut); + + QShortcut* copyShortcutMeta = new QShortcut(metaKey("c"), te, SLOT(copy())); + copyShortcutMeta->setContext(Qt::WidgetShortcut); + + QShortcut* selectAllShortcutMeta = new QShortcut(metaKey("a"), te, SLOT(selectAll())); + selectAllShortcutMeta->setContext(Qt::WidgetShortcut); } + QString MainWindow::asciiArtLogo() { return readFile(":/images/logo.txt");