diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2014-10-01 16:23:02 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-10-02 07:35:23 -0700 |
commit | e0b60167f2366092f2e38436d443f0e2bcfe417d (patch) | |
tree | 17e3dd326d1b0062df3a9058c712b65c6ee9aed6 /qt-ui/divelistview.cpp | |
parent | 28800622f00b07724b3395eacc49f1ee87b42d08 (diff) | |
download | subsurface-e0b60167f2366092f2e38436d443f0e2bcfe417d.tar.gz |
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>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index a8f718c31..29a2301b9 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -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); |