An abstract subclass of QSortFilterProxyModel for sorting and filtering of AbstractTreeModels.
More...
#include <BasicFilterTreeModel.h++>
template<class T, class IS = QDataStream, class OS = QDataStream>
class quark::gui::BasicFilterTreeModel< T, IS, OS >
An abstract subclass of QSortFilterProxyModel for sorting and filtering of AbstractTreeModels.
Subclasses must provide a suitable public constructor and implement filterAcceptsItem(), filterAcceptsField(), and/or fieldLessThan().
- Template Parameters
-
- Author
- Mark Lindner
◆ ~BasicFilterTreeModel()
◆ BasicFilterTreeModel()
◆ fieldLessThan()
virtual bool fieldLessThan |
( |
int |
field, |
|
|
const QVariant & |
value1, |
|
|
const QVariant & |
value2 |
|
) |
| const |
|
protectedvirtual |
Compares the values of a given field of two items in the model, for the purpose of sorting.
The default implementation compares the string representations of the two values.
- Parameters
-
field | The field number. |
value1 | The field's value in the first item. |
value2 | The field's value in the second item. |
- Returns
- true if value1 < value2, false otherwise.
◆ filterAcceptsField()
virtual bool filterAcceptsField |
( |
int |
field | ) |
const |
|
protectedvirtual |
Called to test whether a given field in the model is accepted by this filter.
The default implementation is a no-op that returns true.
- Parameters
-
field | The field number to filter. |
- Returns
- true if the filter accepts the ifield, false otherwise.
◆ filterAcceptsItem()
virtual bool filterAcceptsItem |
( |
const T & |
item | ) |
const |
|
protectedvirtual |
Called to test whether a given item in the model is accepted by this filter.
The default implementation is a no-op that returns true.
- Parameters
-
- Returns
- true if the filter accepts the item, false otherwise.
◆ getItemForIndex()
T* getItemForIndex |
( |
const QModelIndex & |
index | ) |
const |
Returns the filtered item at the given index in this model.
◆ sourceModel()
Returns this filter model's source model.
The documentation for this class was generated from the following file: