KDE 4.5 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

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.CollectionFilterProxyModel *proxy = new Akonadi.CollectionFilterProxyModel();
   proxy->addMimeTypeFilter( "message/rfc822" );
   proxy->setSourceModel( model );

   QTreeView *view = new QTreeView( this );
   view->setModel( proxy );

Author:
Bruno Virlet <bruno.virlet@gmail.com>


Methods

 __init__ (self, QObject parent=0)
 addMimeTypeFilter (self, QString mimeType)
 addMimeTypeFilters (self, QStringList mimeTypes)
 clearFilters (self)
bool filterAcceptsRow (self, int sourceRow, QModelIndex sourceParent)
Qt::ItemFlags flags (self, QModelIndex index)
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
)

Adds a mime type to be shown by the filter.

Parameters:
mimeType  A mime type to be shown.

addMimeTypeFilters (  self,
QStringList  mimeTypes
)

Adds a list of mime types to be shown by the filter.

Parameters:
mimeTypes  A list of mime types to be shown.

clearFilters (   self )

Clears all mime type filters.

bool filterAcceptsRow (  self,
int  sourceRow,
QModelIndex  sourceParent
)
Qt::ItemFlags flags (  self,
QModelIndex  index
)
QStringList mimeTypeFilters (   self )

Returns the list of mime type filters.

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal