KDE 4.9 PyKDE API Reference

- KDE's Python API

# CollectionStatisticsModel Class Reference

`from PyKDE4.akonadi import *`

Inherits: Akonadi.CollectionModel → QAbstractItemModel → QObject
Namespace: Akonadi

## Detailed Description

A model that provides statistics for collections.

This model extends the CollectionModel by providing additional information about the collections, e.g. the number of items in a collection, the number of read/unread items, or the total size of the collection.

Example:

     QTreeView *view = new QTreeView( this );

     Akonadi.CollectionStatisticsModel *model = new Akonadi.CollectionStatisticsModel( view );
     view->setModel( model );

Author:
  Volker Krause <vkrause@kde.org>

Deprecated:
  Use Akonadi.EntityTreeModel with an Akonadi.StatisticsProxyModel on top

## Enumerations
Roles | { UnreadRole, TotalRole, StatisticsRole, RecursiveUnreadRole, RecursiveTotalRole, RecursiveStatisticsRole, SizeRole, RecursiveSizeRole, UserRole }
## Methods
| __init__ (self, QObject parent=0)
int | columnCount (self, QModelIndex parent=QModelIndex())
QVariant | data (self, QModelIndex index, int role=Qt.DisplayRole)
QVariant | headerData (self, int section, Qt::Orientation orientation, int role=Qt.DisplayRole)

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

Creates a new collection statistics model.

Parameters:

  | parent | The parent object.

int columnCount | ( | self, |
|  | QModelIndex | parent=QModelIndex()
| ) |  |  |

QVariant data | ( | self, |
|  | QModelIndex | index,
|  | int | role=Qt.DisplayRole
| ) |  |  |

QVariant headerData | ( | self, |
|  | int | section,
|  | Qt::Orientation | orientation,
|  | int | role=Qt.DisplayRole
| ) |  |  |

## Enumeration Documentation

Roles

Describes the roles for the statistics collection model.

Enumerator:

  IdRole = Qt::UserRole+1 |
  ItemRole |
  MimeTypeRole |
  UserRole = Qt::UserRole+42 |