# class CollectionFilterProxyModel

###

Module | akonadi
Namespace | Akonadi
Class | CollectionFilterProxyModel
Inherits | QSortFilterProxyModel

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 );

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

### methods

- CollectionFilterProxyModel (parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parent | QObject | 0

  Creates a new collection proxy filter model.

  parent - The parent object

- addMimeTypeFilter (mimeType)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  mimeType | QString |

  Add mime type to be shown by the filter.

  mimeType - A mime type to be shown.

- addMimeTypeFilters (mimeTypes)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  mimeTypes | QStringList |

  Add mime types to be shown by the filter.

  mimeTypes - A list of mime types to be shown.

- clearFilters ( )

  returns Nothing

  Clear all mime type filters.

- filterAcceptsRow (sourceRow, sourceParent)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  sourceRow | int |
  sourceParent | QModelIndex |

- mimeTypeFilters ( )

  returns QStringList

  Returns the list of mime type filters.