QAdvanced Item View
0.4
The QAIV (Qt Advanced Item Views) library provides GUI and utility classes extending the capabilities of the Qt item views.
|
The QAbstractFilterModel class provides the abstract interface for filter model classes. More...
#include <qabstractfiltermodel.h>
Classes | |
struct | FilterTypeEntry |
Public Types | |
enum | ItemDataRole { ValueFilterTypeRole = Qt::UserRole + 42, DefaultFilterTypeRole, ColumnFilterTypesRole } |
Signals | |
void | matchModeChanged (QAdvancedItemViews::FilterMatchMode mode) |
void | modeChanged (QAdvancedItemViews::FilterProxyMode mode) |
Public Member Functions | |
QAbstractFilterModel (QObject *parent=0) | |
~QAbstractFilterModel () | |
int | columnCount (const QModelIndex &parent=QModelIndex()) const |
virtual QAbstractFilter * | createFilter (const QModelIndex &index, const QVariantMap &properties) const =0 |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
QFilterGroup * | filterGroup (const QModelIndex &index) const |
QFilterGroup * | groupAt (int row) const |
QAbstractFilter * | filter (const QModelIndex &index) const |
QIcon | filterDisabledIcon () const |
QIcon | filterEnabledIcon () const |
QList< QAbstractFilter * > | filtersAtRow (int row) const |
Qt::ItemFlags | flags (const QModelIndex &index) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
QAdvancedItemViews::FilterMatchMode | matchMode () const |
QAdvancedItemViews::FilterProxyMode | mode () const |
QModelIndex | parent (const QModelIndex &index) const |
QList< FilterTypeEntry > | registeredFilterTypes () const |
bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
void | setDefaultFilterType (int column, int type) |
void | setFilterDisabledIcon (const QIcon &icon) |
void | setFilterEnabledIcon (const QIcon &icon) |
bool | setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role=Qt::EditRole) |
void | setMatchMode (QAdvancedItemViews::FilterMatchMode flag) |
void | setMode (QAdvancedItemViews::FilterProxyMode mode) |
void | setSourceModel (QAbstractItemModel *model) |
QAbstractItemModel * | sourceModel () const |
Protected Member Functions | |
bool | registerFilter (int type, const QString &text, const QString &toolTip=QString()) |
bool | registerFilter (int type, const QIcon &icon, const QString &text, const QString &toolTip=QString()) |
The QAbstractFilterModel class provides the abstract interface for filter model classes.
The QAbstractFilterModel class defines the standard interface that filter models must use to be able to interoperate with an advanced table view.
The QAbstractFilterModel defined additional item data roles for data needed by the view.
QAbstractFilterModel::QAbstractFilterModel | ( | QObject * | parent = 0 | ) |
Constructs an abstract filter model with the given parent
.
QAbstractFilterModel::~QAbstractFilterModel | ( | ) |
Destroys the abstract filter model.
int QAbstractFilterModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const |
Returns the number of columns of the underlaying data (source) model.
QVariant QAbstractFilterModel::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const |
Returns the data stored under the given role
for the filter referred to by the index
.
index
is invalid or no folter exists for the the given index
. QAbstractFilter * QAbstractFilterModel::filter | ( | const QModelIndex & | index | ) | const |
Returns the filter at the specified index
.
QIcon QAbstractFilterModel::filterDisabledIcon | ( | ) | const |
Returns the icon shown of a filter is disabled.
QIcon QAbstractFilterModel::filterEnabledIcon | ( | ) | const |
Returns the icon shown of a filter is disabled.
QFilterGroup * QAbstractFilterModel::filterGroup | ( | const QModelIndex & | index | ) | const |
Returns the filter group for the given index
or 0 if no filter group exists for the specified index
.
Qt::ItemFlags QAbstractFilterModel::flags | ( | const QModelIndex & | index | ) | const |
Returns the item flags for the given index
.
QFilterGroup * QAbstractFilterModel::groupAt | ( | int | row | ) | const |
Return the filter group at row
or 0 if there is no filter group at the specified row
.
QModelIndex QAbstractFilterModel::parent | ( | const QModelIndex & | index | ) | const |
Returns an invalid index.
QList< QAbstractFilterModel::FilterTypeEntry > QAbstractFilterModel::registeredFilterTypes | ( | ) | const |
Returns a list of registered filter types.
|
protected |
Registers the given filter type
with its text
and toolTip
.
|
protected |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void QAbstractFilterModel::setDefaultFilterType | ( | int | column, |
int | type | ||
) |
Sets the default filter type for the specified column
to type
.
void QAbstractFilterModel::setFilterDisabledIcon | ( | const QIcon & | icon | ) |
Sets the icon shown if a filter is disabled to icon
.
void QAbstractFilterModel::setFilterEnabledIcon | ( | const QIcon & | icon | ) |
Sets the icon shown if a filter is enabled to icon
.
void QAbstractFilterModel::setSourceModel | ( | QAbstractItemModel * | model | ) |
Sets the given source model
to be processed by the filter model.
QAbstractItemModel * QAbstractFilterModel::sourceModel | ( | ) | const |
Returns the model that contains the data this filter model is used for filtering.