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.
 All Classes Functions Variables Enumerations Enumerator Properties Groups Pages
Classes | Public Types | Signals | Public Member Functions | Protected Member Functions | List of all members
QAbstractFilterModel Class Referenceabstract

The QAbstractFilterModel class provides the abstract interface for filter model classes. More...

#include <qabstractfiltermodel.h>

Inheritance diagram for QAbstractFilterModel:


struct  FilterTypeEntry

Public Types

enum  ItemDataRole { ValueFilterTypeRole = Qt::UserRole + 42, DefaultFilterTypeRole, ColumnFilterTypesRole }


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 QAbstractFiltercreateFilter (const QModelIndex &index, const QVariantMap &properties) const =0
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
QFilterGroupfilterGroup (const QModelIndex &index) const
QFilterGroupgroupAt (int row) const
QAbstractFilterfilter (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< FilterTypeEntryregisteredFilterTypes () 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())

Detailed Description

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.

Member Enumeration Documentation

The QAbstractFilterModel defined additional item data roles for data needed by the view.

Constructor & Destructor Documentation

QAbstractFilterModel::QAbstractFilterModel ( QObject *  parent = 0)

Constructs an abstract filter model with the given parent.

QAbstractFilterModel::~QAbstractFilterModel ( )

Destroys the abstract filter model.

Member Function Documentation

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.

Returns an invalid QVariant if the given index is invalid or no folter exists for the the given index.
See also
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.

See also
QIcon QAbstractFilterModel::filterEnabledIcon ( ) const

Returns the icon shown of a filter is disabled.

See also
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.

bool QAbstractFilterModel::registerFilter ( int  type,
const QString &  text,
const QString &  toolTip = QString() 

Registers the given filter type with its text and toolTip.

QAbstractFilterModel::registerFilter ( int  type,
const QIcon &  icon,
const QString &  text,
const QString &  toolTip = QString() 

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.

See also
filterDisabledIcon(), setFilterEnabledIcon()
void QAbstractFilterModel::setFilterEnabledIcon ( const QIcon &  icon)

Sets the icon shown if a filter is enabled to icon.

See also
filterEnabledIcon(), setFilterDisabledIcon()
void QAbstractFilterModel::setSourceModel ( QAbstractItemModel *  model)

Sets the given source model to be processed by the filter model.

See also
QAbstractItemModel * QAbstractFilterModel::sourceModel ( ) const

Returns the model that contains the data this filter model is used for filtering.

The documentation for this class was generated from the following files: