akonadi
Akonadi::CollectionStatisticsDelegate Class Reference
A delegate that draws unread and total count for CollectionStatisticsModel. More...
#include <collectionstatisticsdelegate.h>
Inherits QStyledItemDelegate.
Public Slots | |
bool | progressAnimationEnabled () const |
void | setProgressAnimationEnabled (bool enable) |
void | setUnreadCountShown (bool enable) |
bool | unreadCountShown () const |
Public Member Functions | |
CollectionStatisticsDelegate (QTreeView *parent) | |
~CollectionStatisticsDelegate () | |
Protected Member Functions | |
virtual void | initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const |
virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
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:
Akonadi::EntityTreeView *view = new Akonadi::EntityTreeView( this ); Akonadi::StatisticsProxyModel *statisticsProxy = new Akonadi::StatisticsProxyModel( view ); view->setModel( statisticsProxy ); Akonadi::CollectionStatisticsDelegate *delegate = new Akonadi::CollectionStatisticsDelegate( view ); view->setItemDelegate( delegate );
- Note:
- This proxy model is intended to be used on top of the EntityTreeModel. One of the proxies between the EntityTreeModel (the root model) and the view must be a StatisticsProxyModel. That proxy model may appear anywhere in the chain.
Definition at line 63 of file collectionstatisticsdelegate.h.
Constructor & Destructor Documentation
Akonadi::CollectionStatisticsDelegate::CollectionStatisticsDelegate | ( | QTreeView * | parent | ) | [explicit] |
Creates a new collection statistics delegate.
- Parameters:
-
parent The parent tree view, which will also take ownership.
Akonadi::CollectionStatisticsDelegate::~CollectionStatisticsDelegate | ( | ) |
Destroys the collection statistics delegate.
Member Function Documentation
void Akonadi::CollectionStatisticsDelegate::setUnreadCountShown | ( | bool | enable | ) | [slot] |
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, iffalse
, the folder name will be drawn normally.
bool Akonadi::CollectionStatisticsDelegate::unreadCountShown | ( | ) | const [slot] |
Returns whether the unread count is drawn next to the folder name.
The documentation for this class was generated from the following file: