CollectionStatisticsDelegate Class Reference
from PyKDE4.akonadi import *
Inherits: QStyledItemDelegate → QAbstractItemDelegate → QObject
Namespace: Akonadi
Detailed Description
A delegate that draws unread and total count for CollectionStatisticsModel.
The delegate provides the following features:
- Collections with unread items will have the foldername and the unread column marked in bold. - If a folder is collapsed, the unread and the total column will contain the total sum of all child folders - It has the possibility to draw the unread count directly after the foldername, see toggleUnreadAfterFolderName().
Example:
QTreeView *view = new QTreeView( this ); Akonadi.CollectionStatisticsModel *model = new Akonadi.CollectionStatisticsModel( view ); view->setModel( model ); Akonadi.CollectionStatisticsDelegate *delegate = new Akonadi.CollectionStatisticsDelegate( view ); view->setItemDelegate( delegate );
Methods | |
__init__ (self, QTreeView parent) | |
initStyleOption (self, QStyleOptionViewItem option, QModelIndex index) | |
paint (self, QPainter painter, QStyleOptionViewItem option, QModelIndex index) | |
setUnreadCountShown (self, bool enable) | |
bool | unreadCountShown (self) |
Method Documentation
__init__ | ( | self, | ||
QTreeView | parent | |||
) |
Creates a new collection statistics delegate.
- Parameters:
-
parent The parent tree view, which will also take ownership.
initStyleOption | ( | self, | ||
QStyleOptionViewItem | option, | |||
QModelIndex | index | |||
) |
paint | ( | self, | ||
QPainter | painter, | |||
QStyleOptionViewItem | option, | |||
QModelIndex | index | |||
) |
setUnreadCountShown | ( | self, | ||
bool | enable | |||
) |
Sets whether the unread count is drawn next to the folder name.
You probably want to enable this when the unread count is hidden only. This is disabled by default.
- Parameters:
-
enable If true, the unread count is drawn next to the folder name, if false, the folder name will be drawn normally.
bool unreadCountShown | ( | self ) |
Returns whether the unread count is drawn next to the folder name.