An abstract subclass of QSortFilterProxyModel for sorting and filtering of AbstractTableModels.
More...
#include <BasicFilterTableModel.h++>
template<class T, class IS = QDataStream, class OS = QDataStream>
class quark::gui::BasicFilterTableModel< T, IS, OS >
An abstract subclass of QSortFilterProxyModel for sorting and filtering of AbstractTableModels.
Subclasses must provide a suitable public constructor and implement filterAcceptsItem(), filterAcceptsField() and/or fieldLessThan().
- Template Parameters
-
- Author
- Mark Lindner
◆ ~BasicFilterTableModel()
◆ BasicFilterTableModel()
◆ 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.
◆ getItemAt()
T* getItemAt |
( |
int |
row | ) |
const |
Returns the filtered item at the given row in this model.
◆ getItemForIndex()
T* getItemForIndex |
( |
const QModelIndex & |
index | ) |
const |
Returns the filtered item at the given index in this model.
◆ isEditable()
bool isEditable |
( |
| ) |
const |
Tests whether this model is editable.
◆ isEmpty()
Tests if this model is empty.
◆ itemCount()
Returns the number of (filtered) items in this model.
◆ setEditable()
void setEditable |
( |
bool |
editable | ) |
|
Sets the editability of this model.
◆ sourceModel()
Returns this filter model's source model.
The documentation for this class was generated from the following file: