diff --git a/resources/news.txt b/resources/news.txt index 7311de9aa..14f04be2e 100644 --- a/resources/news.txt +++ b/resources/news.txt @@ -1,4 +1,9 @@ + 2.17.3: In progress... + + FIXED: Delete key shortcut for bookmark removal. + + 2.17.2: Released October 9, 2023 NEW: FORCE_QT6 and FORCE_QT5 CMake options to force Qt version. diff --git a/src/qtgui/dockbookmarks.cpp b/src/qtgui/dockbookmarks.cpp index 5511d6968..ff518588d 100644 --- a/src/qtgui/dockbookmarks.cpp +++ b/src/qtgui/dockbookmarks.cpp @@ -158,12 +158,20 @@ void DockBookmarks::on_tableWidgetTagList_itemChanged(QTableWidgetItem *item) bool DockBookmarks::eventFilter(QObject* object, QEvent* event) { - if (event->type() == QEvent::KeyPress) + // Since Key_Delete can be (is) used as a global shortcut, override the + // shortcut. Accepting a ShortcutOverride causes the event to be delivered + // again, but as a KeyPress. + if (event->type() == QEvent::KeyPress || event->type() == QEvent::ShortcutOverride) { QKeyEvent* pKeyEvent = static_cast(event); - if (pKeyEvent->key() == Qt::Key_Delete && ui->tableViewFrequencyList->hasFocus()) + if (pKeyEvent->key() == Qt::Key_Delete) { - return DeleteSelectedBookmark(); + if (event->type() == QEvent::ShortcutOverride) { + event->accept(); + } + else { + return DeleteSelectedBookmark(); + } } } return QWidget::eventFilter(object, event);