CollectionFilterProxyModel Class Reference
from PyKDE4.akonadi import *
Inherits: QSortFilterProxyModel → QAbstractProxyModel → QAbstractItemModel → QObject
Namespace: Akonadi
Detailed Description
A proxy model that filters collections by mime type.
This class can be used on top of a CollectionModel to filter out all collections that doesn't match a given mime type.
For instance, a mail application will use addMimeType( "message/rfc822" ) to only show collections containing mail.
Akonadi.CollectionModel *model = new Akonadi.CollectionModel( this ); Akonadi.CollectionFilterProxy *proxy = new Akonadi.CollectionFilterProxyModel(); proxy->addMimeTypeFilter( "message/rfc822" ); proxy->setSourceModel( model ); QTreeView *view = new QTreeView( this ); view->setModel( proxy );
Methods | |
__init__ (self, QObject parent=0) | |
addMimeTypeFilter (self, QString mimeType) | |
addMimeTypeFilters (self, QStringList mimeTypes) | |
clearFilters (self) | |
bool | filterAcceptsRow (self, int sourceRow, QModelIndex sourceParent) |
QStringList | mimeTypeFilters (self) |
Method Documentation
__init__ | ( | self, | ||
QObject | parent=0 | |||
) |
Creates a new collection proxy filter model.
- Parameters:
-
parent The parent object.
addMimeTypeFilter | ( | self, | ||
QString | mimeType | |||
) |
Add mime type to be shown by the filter.
- Parameters:
-
mimeType A mime type to be shown.
addMimeTypeFilters | ( | self, | ||
QStringList | mimeTypes | |||
) |
Add mime types to be shown by the filter.
- Parameters:
-
mimeTypes A list of mime types to be shown.
clearFilters | ( | self ) |
Clear all mime type filters.
bool filterAcceptsRow | ( | self, | ||
int | sourceRow, | |||
QModelIndex | sourceParent | |||
) |
QStringList mimeTypeFilters | ( | self ) |
Returns the list of mime type filters.