From ec4e6d53dfb9d3cbbcae84680dfe712dbbb025ec Mon Sep 17 00:00:00 2001 From: Zach H Date: Sun, 17 Dec 2017 17:39:41 -0500 Subject: [PATCH] allow backspace button to remove a filter (#2959) --- cockatrice/src/tab_deck_editor.cpp | 2 ++ cockatrice/src/tab_deck_editor.h | 1 + 2 files changed, 3 insertions(+) diff --git a/cockatrice/src/tab_deck_editor.cpp b/cockatrice/src/tab_deck_editor.cpp index 828173bd..a19a2b88 100644 --- a/cockatrice/src/tab_deck_editor.cpp +++ b/cockatrice/src/tab_deck_editor.cpp @@ -158,8 +158,10 @@ void TabDeckEditor::createFiltersDock() filterView->setUniformRowHeights(true); filterView->setHeaderHidden(true); filterView->setContextMenuPolicy(Qt::CustomContextMenu); + filterView->installEventFilter(&filterViewKeySignals); connect(filterModel, SIGNAL(layoutChanged()), filterView, SLOT(expandAll())); connect(filterView, SIGNAL(customContextMenuRequested(const QPoint &)),this, SLOT(filterViewCustomContextMenu(const QPoint &))); + connect(&filterViewKeySignals, SIGNAL(onDelete()), this, SLOT(actClearFilterOne())); FilterBuilder *filterBuilder = new FilterBuilder; filterBuilder->setObjectName("filterBuilder"); diff --git a/cockatrice/src/tab_deck_editor.h b/cockatrice/src/tab_deck_editor.h index 22d9ba87..9c8cca05 100644 --- a/cockatrice/src/tab_deck_editor.h +++ b/cockatrice/src/tab_deck_editor.h @@ -108,6 +108,7 @@ private: QLabel *hashLabel; FilterTreeModel *filterModel; QTreeView *filterView; + KeySignals filterViewKeySignals; QWidget *filterBox; QMenu *deckMenu, *viewMenu, *cardInfoDockMenu, *deckDockMenu, *filterDockMenu, *analyzeDeckMenu;