AgentFilterProxyModel Class Reference
from PyKDE4.akonadi import *
Inherits: QSortFilterProxyModel → QAbstractProxyModel → QAbstractItemModel → QObject
Namespace: Akonadi
Detailed Description
A proxy model for filtering AgentType or AgentInstance
This filter proxy model works on top of a AgentTypeModel or AgentInstanceModel and can be used to show only AgentType or AgentInstance objects which provide a given mime type or capability.
// Show only running agent instances that provide contacts Akonadi.AgentInstanceModel *model = new Akonadi.AgentInstanceModel( this ); Akonadi.AgentFilterProxyModel *proxy = new Akonadi.AgentFilterProxyModel( this ); proxy->addMimeTypeFilter( "text/directory" ); proxy->setSourceModel( model ); QListView *view = new QListView( this ); view->setModel( proxy );
Methods | |
| __init__ (self, QObject parent=0) | |
| addCapabilityFilter (self, QString capability) | |
| addMimeTypeFilter (self, QString mimeType) | |
| clearFilters (self) | |
| bool | filterAcceptsRow (self, int row, QModelIndex parent) |
Method Documentation
| __init__ | ( | self, | ||
| QObject | parent=0 | |||
| ) |
Create a new agent filter proxy model. By default no filtering is done.
| addCapabilityFilter | ( | self, | ||
| QString | capability | |||
| ) |
Accept agents with the given capability.
| addMimeTypeFilter | ( | self, | ||
| QString | mimeType | |||
| ) |
Accept agents supporting mimeType.
| clearFilters | ( | self ) |
Clear the filters ( mimeTypes & capabilities ).
| bool filterAcceptsRow | ( | self, | ||
| int | row, | |||
| QModelIndex | parent | |||
| ) |
KDE 4.3 PyKDE API Reference