CollectionModel Class Reference
from PyKDE4.akonadi import *
Inherits: QAbstractItemModel → QObject
Subclasses: Akonadi.CollectionStatisticsModel
Namespace: Akonadi
Detailed Description
A model for collections.
This class provides the interface of QAbstractItemModel for the
collection tree of the Akonadi storage.
Akonadi.CollectionModel *model = new Akonadi.CollectionModel( this );
QTreeView *view = new QTreeView( this );
view->setModel( model );
If you want to list only collections of a special mime type, use
CollectionFilterProxyModel on top of this model.
- Author:
- Volker Krause <vkrause@kde.org>
Enumerations |
Roles | { CollectionIdRole, CollectionRole, UserRole } |
Methods |
| __init__ (self, QObject parent=0) |
| __init__ (self, CollectionModelPrivate d, QObject parent=0) |
Akonadi.Collection | collectionForId (self, Collection.Id id) |
int | columnCount (self, QModelIndex parent=QModelIndex()) |
QVariant | data (self, QModelIndex index, int role=Qt.DisplayRole) |
bool | dropMimeData (self, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) |
| fetchCollectionStatistics (self, bool enable) |
Qt.ItemFlags | flags (self, QModelIndex index) |
QVariant | headerData (self, int section, Qt.Orientation orientation, int role=Qt.DisplayRole) |
| includeUnsubscribed (self, bool include=1) |
QModelIndex | index (self, int row, int column, QModelIndex parent=QModelIndex()) |
QMimeData | mimeData (self, QModelIndexList indexes) |
QStringList | mimeTypes (self) |
QModelIndex | parent (self, QModelIndex index) |
int | rowCount (self, QModelIndex parent=QModelIndex()) |
bool | setData (self, QModelIndex index, QVariant value, int role=Qt.EditRole) |
Qt.DropActions | supportedDropActions (self) |
Method Documentation
__init__ |
( |
self, |
|
|
|
QObject |
parent=0 |
|
) |
|
|
|
Creates a new collection model.
- Parameters:
-
| parent | The parent object.
|
__init__ |
( |
self, |
|
|
|
CollectionModelPrivate |
d, |
|
|
QObject |
parent=0 |
|
) |
|
|
|
Returns the collection for a given collection id.
int columnCount |
( |
self, |
|
|
|
QModelIndex |
parent=QModelIndex() |
|
) |
|
|
|
fetchCollectionStatistics |
( |
self, |
|
|
|
bool |
enable |
|
) |
|
|
|
Sets whether collection statistics information shall be provided
by the model.
- See also:
- CollectionStatistics.
includeUnsubscribed |
( |
self, |
|
|
|
bool |
include=1 |
|
) |
|
|
|
Sets whether unsubscribed collections shall be listed in the model.
QMimeData mimeData |
( |
self, |
|
|
|
QModelIndexList |
indexes |
|
) |
|
|
|
int rowCount |
( |
self, |
|
|
|
QModelIndex |
parent=QModelIndex() |
|
) |
|
|
|
Enumeration Documentation
Describes the roles for collections.
- Enumerator:
-
CollectionIdRole = Qt::UserRole+1 | |
CollectionRole | |
UserRole = Qt::UserRole+42 | |