KDE 4.7 PyKDE API Reference

- KDE's Python API

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

Author:
  Volker Krause <vkrause@kde.org>

## Methods
| __init__ (self, QObject parent=0)
| addCapabilityFilter (self, QString capability)
| addMimeTypeFilter (self, QString mimeType)
| clearFilters (self)
| excludeCapabilities (self, QString capability)
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 ).

excludeCapabilities | ( | self, |
|  | QString | capability
| ) |  |  |

Excludes agents with the given capability.

Since:
  4.6

bool filterAcceptsRow | ( | self, |
|  | int | row,
|  | QModelIndex | parent
| ) |  |  |