Akonadi

collectionstatisticsdelegate.h
1 /*
2  SPDX-FileCopyrightText: 2008 Thomas McGuire <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 #ifndef AKONADI_COLLECTIONSTATISTICSDELEGATE_H
7 #define AKONADI_COLLECTIONSTATISTICSDELEGATE_H
8 
9 #include "akonadiwidgets_export.h"
10 
11 #include <QStyledItemDelegate>
12 
13 class QAbstractItemView;
14 class QTreeView;
15 
16 namespace Akonadi
17 {
18 
19 class CollectionStatisticsDelegatePrivate;
20 
52 class AKONADIWIDGETS_EXPORT CollectionStatisticsDelegate : public QStyledItemDelegate
53 {
54  Q_OBJECT
55 
56 public:
57 
66 
72  explicit CollectionStatisticsDelegate(QTreeView *parent);
73 
77  ~CollectionStatisticsDelegate() override;
78 
82  void updatePalette();
83 
93  void setUnreadCountShown(bool enable);
94 
98  bool unreadCountShown() const;
99 
103  void setProgressAnimationEnabled(bool enable);
104 
105  bool progressAnimationEnabled() const;
106 
107 protected:
113  void paint(QPainter *painter, const QStyleOptionViewItem &option,
114  const QModelIndex &index) const override;
115 
120  void initStyleOption(QStyleOptionViewItem *option,
121  const QModelIndex &index) const override;
122 
123 private:
124  //@cond PRIVATE
125  CollectionStatisticsDelegatePrivate *const d_ptr;
126  //@endcond
127 
128  Q_DECLARE_PRIVATE(CollectionStatisticsDelegate)
129 };
130 
131 }
132 
133 #endif
Helper integration between Akonadi and Qt.
A delegate that draws unread and total count for StatisticsProxyModel.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 8 2020 23:15:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.