![]() |
Home · Modules · Classes · Namespaces · Functions |
The QxtSortFilterProxyModel class is a multi column filter model. More...
#include <QxtSortFilterProxyModel>
Inherits QSortFilterProxyModel.
The QxtSortFilterProxyModel class is a multi column filter model.
The QxtSortFilterProxyModel makes it possible to filter over multiple columns.
QxtSortFilterProxyModel * filterModel = new QxtSortFilterProxyModel(parent);
filterModel->setSourceModel(sourceModel);
filterModel->beginDeclareFilter();
filterModel->setFilter(1,QVariant("SomeStringValue"),Qt::DisplayRole,Qt::MatchExactly);
//remove some old filter
filterModel->removeFilter(2);
filterModel->setFilter(5,QVariant(1234),Qt::DisplayRole,Qt::MatchExactly);
filterModel->endDeclateFilter();
Now the model will filter column 1 and 5, to be accepted by the filtermodel a row needs to pass all filters
Constructs a new QxtSortFilterProxyModel with parent.
tells the model you want to declare a new filter
If you have a lot of data in your model it can be slow to declare more than one filter, because the model will always rebuild itself. If you call this member before setting the new filters the model will invalidate its contents not before you call
See also endDeclareFilter().
stops the filter declaration and invalidates the filter
See also beginDeclareFilter().
returns the filter flags for the given column
Note: if the column is not filtered it will return the default value
See also setFilterFlags().
Returns the filter role for the given column
Note: if the column is not filtered it will return -1
See also setFilterRole().
Returns the filter value for the given column
Note: if the column is not filtered it will return a null variant
See also setFilterValue().
Returns true if the column is filtered
Removes the filter from the given column
Sets the filter with value, role and flags to the given column
Sets the filter flags for the given column
See also filterFlags().
Sets the filter role for the given column
See also filterRole().
Sets the filter value for the given column
See also filterValue().
Copyright © 2007-2010 Qxt Foundation |
Qxt 0.6.1 |