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:
Tomaz Canabrava 2014-10-01 16:23:02 -03:00 committed by Dirk Hohndel
parent 28800622f0
commit e0b60167f2
5 changed files with 86 additions and 19 deletions

View file

@ -464,3 +464,15 @@ TagFilter::TagFilter(QWidget *parent) : QWidget(parent)
connect(ui.filterTag, SIGNAL(textChanged(QString)), filter, SLOT(setFilterFixedString(QString)));
ui.tagView->setModel(filter);
}
void TagFilter::showEvent(QShowEvent *event)
{
TagFilterSortModel::instance()->addFilterModel(TagFilterModel::instance());
QWidget::showEvent(event);
}
void TagFilter::hideEvent(QHideEvent *event)
{
TagFilterSortModel::instance()->removeFilterModel(TagFilterModel::instance());
QWidget::hideEvent(event);
}