akonadi
#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 (QAbstractItemView *parent) | |
CollectionStatisticsDelegate (QTreeView *parent) | |
~CollectionStatisticsDelegate () | |
void | updatePalette () |
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:
- 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 64 of file collectionstatisticsdelegate.h.
Constructor & Destructor Documentation
◆ CollectionStatisticsDelegate() [1/2]
|
explicit |
Creates a new collection statistics delegate.
- Parameters
-
parent The parent item view, which will also take ownership.
- Since
- 4.6
Definition at line 97 of file collectionstatisticsdelegate.cpp.
◆ CollectionStatisticsDelegate() [2/2]
|
explicit |
Creates a new collection statistics delegate.
- Parameters
-
parent The parent tree view, which will also take ownership.
Definition at line 104 of file collectionstatisticsdelegate.cpp.
◆ ~CollectionStatisticsDelegate()
CollectionStatisticsDelegate::~CollectionStatisticsDelegate | ( | ) |
Destroys the collection statistics delegate.
Definition at line 111 of file collectionstatisticsdelegate.cpp.
Member Function Documentation
◆ initStyleOption()
|
protectedvirtual |
- Parameters
-
option style option view item index model index (QModelIndex)
Definition at line 150 of file collectionstatisticsdelegate.cpp.
◆ paint()
|
protectedvirtual |
- Parameters
-
painter pointer for QPainter to use in method option style options index model index (QModelIndex)
Definition at line 196 of file collectionstatisticsdelegate.cpp.
◆ progressAnimationEnabled
|
slot |
Definition at line 144 of file collectionstatisticsdelegate.cpp.
◆ setProgressAnimationEnabled
|
slot |
- Parameters
-
enable new mode of progress animation
Definition at line 128 of file collectionstatisticsdelegate.cpp.
◆ setUnreadCountShown
|
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.
Definition at line 116 of file collectionstatisticsdelegate.cpp.
◆ unreadCountShown
|
slot |
Returns whether the unread count is drawn next to the folder name.
Definition at line 122 of file collectionstatisticsdelegate.cpp.
◆ updatePalette()
void CollectionStatisticsDelegate::updatePalette | ( | ) |
- Since
- 4.9.1
Definition at line 359 of file collectionstatisticsdelegate.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.