Akonadi::CollectionStatisticsDelegate
#include <collectionstatisticsdelegate.h>
Protected Member Functions | |
void | initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const override |
void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
Protected Member Functions inherited from QStyledItemDelegate | |
virtual bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override |
virtual bool | eventFilter (QObject *editor, QEvent *event) override |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
A delegate that draws unread and total count for StatisticsProxyModel.
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 52 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 79 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 85 of file collectionstatisticsdelegate.cpp.
◆ ~CollectionStatisticsDelegate()
|
overridedefault |
Destroys the collection statistics delegate.
Member Function Documentation
◆ initStyleOption()
|
overrideprotectedvirtual |
- Parameters
-
option style option view item index model index (QModelIndex)
Reimplemented from QStyledItemDelegate.
Definition at line 127 of file collectionstatisticsdelegate.cpp.
◆ paint()
|
overrideprotectedvirtual |
- Parameters
-
painter pointer for QPainter to use in method option style options index model index (QModelIndex)
Reimplemented from QStyledItemDelegate.
Definition at line 173 of file collectionstatisticsdelegate.cpp.
◆ progressAnimationEnabled()
bool CollectionStatisticsDelegate::progressAnimationEnabled | ( | ) | const |
Definition at line 121 of file collectionstatisticsdelegate.cpp.
◆ setProgressAnimationEnabled()
void CollectionStatisticsDelegate::setProgressAnimationEnabled | ( | bool | enable | ) |
- Parameters
-
enable new mode of progress animation
Definition at line 105 of file collectionstatisticsdelegate.cpp.
◆ setUnreadCountShown()
void CollectionStatisticsDelegate::setUnreadCountShown | ( | 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, iffalse
, the folder name will be drawn normally.
Definition at line 93 of file collectionstatisticsdelegate.cpp.
◆ unreadCountShown()
bool CollectionStatisticsDelegate::unreadCountShown | ( | ) | const |
Returns whether the unread count is drawn next to the folder name.
Definition at line 99 of file collectionstatisticsdelegate.cpp.
◆ updatePalette()
void CollectionStatisticsDelegate::updatePalette | ( | ) |
- Since
- 4.9.1
Definition at line 326 of file collectionstatisticsdelegate.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:38 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.