akonadi
collectionstatisticsdelegate.cpp
66 void getCountRecursive(const QModelIndex &index, qint64 &totalCount, qint64 &unreadCount, qint64 &totalSize) const
266 unread = QString::fromLatin1(" (%1 + %2)").arg(unreadCount).arg(unreadRecursiveCount - unreadCount);
280 const QColor unreadColor = (option.state & QStyle::State_Selected) ? d->mSelectedUnreadColor : d->mDeselectedUnreadColor;
291 const bool enoughPlaceForText = (option.rect.width() > (folderWidth + unreadWidth + iconRect.width()));
301 unreadRect = QRect(folderRect.right(), folderRect.top(), unreadRect.width(), unreadRect.height());
326 if (index.column() == 1 && ((!expanded && unreadRecursiveCount > 0) || (expanded && unreadCount > 0))) {
334 if (index.column() == 2 && ((!expanded && totalRecursiveCount > 0) || (expanded && totalCount > 0))) {
349 painter->drawText(textRect, option4.displayAlignment | Qt::AlignVCenter, KIO::convertSize((KIO::filesize_t)totalSize));
~CollectionStatisticsDelegate()
Destroys the collection statistics delegate.
Definition: collectionstatisticsdelegate.cpp:111
qint64 count() const
Returns the number of items in this collection or -1 if this information is not available.
Definition: collectionstatistics.cpp:67
virtual int rowCount(const QModelIndex &parent) const =0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
void setProgressAnimationEnabled(bool enable)
Definition: collectionstatisticsdelegate.cpp:128
int right() const
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
Returns the FetchState of a particular item.
Definition: entitytreemodel.h:351
virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const
const QFont & font() const
void updatePalette()
Definition: collectionstatisticsdelegate.cpp:359
void save()
T value() const
int height() const
void setBold(bool enable)
void setFont(const QFont &font)
QString number(int n, int base)
int toInt(bool *ok) const
int top() const
void setPen(const QColor &color)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
int left() const
bool isEmpty() const
int row() const
virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const
Definition: collectionstatisticsdelegate.cpp:150
void drawText(const QPointF &position, const QString &text)
bool isExpanded(const QModelIndex &index) const
bool unreadCountShown() const
Returns whether the unread count is drawn next to the folder name.
Definition: collectionstatisticsdelegate.cpp:122
CollectionStatisticsDelegate(QAbstractItemView *parent)
Creates a new collection statistics delegate.
Definition: collectionstatisticsdelegate.cpp:97
int width(const QString &text, int len) const
void setRight(int x)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: collectionstatisticsdelegate.cpp:196
int width() const
const QAbstractItemModel * model() const
void setUnreadCountShown(bool enable)
Sets whether the unread count is drawn next to the folder name.
Definition: collectionstatisticsdelegate.cpp:116
QVariant data(int role) const
virtual bool hasChildren(const QModelIndex &parent) const
QModelIndex sibling(int row, int column) const
QFontMetrics fontMetrics() const
There is a fetch of items in this collection in progress.
Definition: entitytreemodel.h:376
int column() const
qint64 unreadCount() const
Returns the number of unread items in this collection or -1 if this information is not available...
Definition: collectionstatistics.cpp:77
QString fromLatin1(const char *str, int size)
bool isValid() const
virtual QRect subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const =0
QObject * parent() const
A delegate that draws unread and total count for CollectionStatisticsModel.
Definition: collectionstatisticsdelegate.h:64
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
CollectionStatistics statistics() const
Returns the collection statistics of the collection.
Definition: collection.cpp:238
bool isValid() const
qint64 size() const
Returns the total size of the items in this collection or -1 if this information is not available...
Definition: collectionstatistics.cpp:87
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.