mirror of
https://github.com/gqrx-sdr/gqrx.git
synced 2024-09-21 10:47:10 +00:00
bookmarks: restore Delete key
Delete is used as a global shortcut to clear the waterfall. It is also used to delete a bookmark, when the bookmarks table has focus. Allow the bookmarks table to override the global Delete shortcut. Signed-off-by: Jeff Long <willcode4@gmail.com>
This commit is contained in:
parent
ef017bc877
commit
0a76cc9b03
@ -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<QKeyEvent *>(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);
|
||||
|
Loading…
Reference in New Issue
Block a user