• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

Akonadi::CollectionStatisticsDelegate

Akonadi::CollectionStatisticsDelegate Class Reference

#include <collectionstatisticsdelegate.h>

Inherits QStyledItemDelegate.

List of all members.


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 );

Author:
Thomas McGuire <thomas.mcguire@gmx.net>

Definition at line 59 of file collectionstatisticsdelegate.h.


Public Slots

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

Constructor & Destructor Documentation

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

Creates a new collection statistics delegate.

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

Definition at line 50 of file collectionstatisticsdelegate.cpp.

CollectionStatisticsDelegate::~CollectionStatisticsDelegate (  ) 

Destroys the collection statistics delegate.

Definition at line 56 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:
enable If true, the unread count is drawn next to the folder name, if false, the folder name will be drawn normally.

Definition at line 61 of file collectionstatisticsdelegate.cpp.

bool CollectionStatisticsDelegate::unreadCountShown (  )  const [slot]

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

Definition at line 67 of file collectionstatisticsdelegate.cpp.


The documentation for this class was generated from the following files:
  • collectionstatisticsdelegate.h
  • collectionstatisticsdelegate.cpp

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.6
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal