mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add possibility to filter by more than one criteria at a time
This new version of the TagFilterSortModel actually accepts *any* new MultiFilterInterface. So, how to use it to create a new filter: Implement a class that inherits from MultiFilterInterface Implement the filterRow method TagFilterSortModel::instance->add( myClass ); and you are done. [Dirk Hohndel: removed some debug code and did whitespace cleanup] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
28800622f0
commit
e0b60167f2
5 changed files with 86 additions and 19 deletions
|
@ -34,7 +34,7 @@ DiveListView::DiveListView(QWidget *parent) : QTreeView(parent), mouseClickSelec
|
|||
setItemDelegate(new DiveListDelegate(this));
|
||||
setUniformRowHeights(true);
|
||||
setItemDelegateForColumn(DiveTripModel::RATING, new StarWidgetsDelegate(this));
|
||||
TagFilterSortModel *model = new TagFilterSortModel(this);
|
||||
TagFilterSortModel *model = TagFilterSortModel::instance();
|
||||
model->setSortRole(DiveTripModel::SORT_ROLE);
|
||||
model->setFilterKeyColumn(-1); // filter all columns
|
||||
model->setFilterCaseSensitivity(Qt::CaseInsensitive);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue