• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.5 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • CollectionStatisticsDelegate
Public Slots | Public Member Functions | Protected Member Functions
Akonadi::CollectionStatisticsDelegate Class Reference

#include <collectionstatisticsdelegate.h>

Inherits QStyledItemDelegate.

List of all members.

Public Slots

bool progressAnimationEnabled () const
void setProgressAnimationEnabled (bool enable)
void setUnreadCountShown (bool enable)
bool unreadCountShown () const

Public Member Functions

 CollectionStatisticsDelegate (QAbstractItemView *parent)
 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.
Author:
Thomas McGuire <thomas.mcguire@gmx.net>

Constructor & Destructor Documentation

CollectionStatisticsDelegate::CollectionStatisticsDelegate ( QAbstractItemView *  parent) [explicit]

Creates a new collection statistics delegate.

Parameters:
parentThe parent item view, which will also take ownership.
Since:
4.6

Definition at line 93 of file collectionstatisticsdelegate.cpp.

CollectionStatisticsDelegate::CollectionStatisticsDelegate ( QTreeView *  parent) [explicit]

Creates a new collection statistics delegate.

Parameters:
parentThe parent tree view, which will also take ownership.

Definition at line 100 of file collectionstatisticsdelegate.cpp.

CollectionStatisticsDelegate::~CollectionStatisticsDelegate ( )

Destroys the collection statistics delegate.

Definition at line 107 of file collectionstatisticsdelegate.cpp.


Member Function Documentation

void 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:
enableIf true, the unread count is drawn next to the folder name, if false, the folder name will be drawn normally.

Definition at line 112 of file collectionstatisticsdelegate.cpp.

bool CollectionStatisticsDelegate::unreadCountShown ( ) const [slot]

Returns whether the unread count is drawn next to the folder name.

Definition at line 118 of file collectionstatisticsdelegate.cpp.


The documentation for this class was generated from the following files:
  • collectionstatisticsdelegate.h
  • collectionstatisticsdelegate.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu Aug 2 2012 15:25:21 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Modules
  • Related Pages

kdepimlibs-4.8.5 API Reference

Skip menu "kdepimlibs-4.8.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal