akonadi
statisticsproxymodel.cpp
83 const QString textDirection = (QApplication::layoutDirection() == Qt::LeftToRight) ? QLatin1String("left") : QLatin1String("right");
137 if (!collection.attribute<EntityDisplayAttribute>()->activeIconName().isEmpty() && collection.statistics().unreadCount() > 0) {
169 tip += tipInfo + QString::fromLatin1("</td><td align=\"%3\" valign=\"top\">").arg(textDirection) + tipIcon;
171 tip += tipIcon + QString::fromLatin1("</td><td align=\"%3\" valign=\"top\">").arg(textDirection) + tipInfo;
198 void StatisticsProxyModel::Private::proxyDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
206 QModelIndex extraBottomRight = mParent->index(bottomRight.row(), parentColumnCount - 1, parent);
250 if (m_persistentFirstColumn.at(i) != m_nonPersistentFirstColumn.at(i) && persistentIdx.column() >= columnCount) {
317 QModelIndex Akonadi::StatisticsProxyModel::index(int row, int column, const QModelIndex &parent) const
340 Collection collection = sourceModel()->data(sourceIndex, EntityTreeModel::CollectionRole).value<Collection>();
359 } else if (role == Qt::TextAlignmentRole && index.column() >= d->sourceColumnCount(index.parent())) {
364 Collection collection = sourceModel()->data(sourceIndex, EntityTreeModel::CollectionRole).value<Collection>();
372 Collection collection = sourceModel()->data(sourceIndex, EntityTreeModel::CollectionRole).value<Collection>();
384 QVariant StatisticsProxyModel::headerData(int section, Qt::Orientation orientation, int role) const
420 QModelIndexList StatisticsProxyModel::match(const QModelIndex &start, int role, const QVariant &value,
429 foreach (const QModelIndex &idx, sourceModel()->match(mapToSource(start), role, value, hits, flags)) {
QString activeIconName() const
Returns the icon name of an active item.
Definition: entitydisplayattribute.cpp:152
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
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
Qt::LayoutDirection layoutDirection()
QString iconName() const
Returns the icon name of the icon returned by icon().
Definition: entitydisplayattribute.cpp:67
virtual Qt::ItemFlags flags(const QModelIndex &index) const
void layoutChanged()
Provides statistics information of a Collection.
Definition: collectionstatistics.h:69
QString name() const
virtual void setSourceModel(QAbstractItemModel *sourceModel)
StatisticsProxyModel(QObject *parent=0)
Creates a new statistics proxy model.
Definition: statisticsproxymodel.cpp:284
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
bool isExtraColumnsEnabled() const
Return true if we display extra statistics columns, otherwise false.
Definition: statisticsproxymodel.cpp:312
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, QFlags< Qt::MatchFlag > flags) const
const QColor & color(ColorGroup group, ColorRole role) const
typedef MatchFlags
T value() const
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
virtual int rowCount(const QModelIndex &parent) const
Attribute * attribute(const QByteArray &name) const
Returns the attribute of the given type name if available, 0 otherwise.
Definition: entity.cpp:167
void layoutAboutToBeChanged()
bool isValid() const
QString number(int n, int base)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
qint64 currentValue() const
Returns the current quota value in bytes.
Definition: collectionquotaattribute.cpp:64
A proxy model that exposes collection statistics through extra columns.
Definition: statisticsproxymodel.h:51
bool isEmpty() const
void setToolTipEnabled(bool enable)
Definition: statisticsproxymodel.cpp:297
int row() const
void * internalPointer() const
virtual QVariant data(const QModelIndex &index, int role) const =0
QModelIndex parent() const
QPalette palette()
virtual QVariant data(const QModelIndex &proxyIndex, int role) const
qint64 maximumValue() const
Returns the maximum quota value in bytes.
Definition: collectionquotaattribute.cpp:69
virtual void connectNotify(const char *signal)
virtual ~StatisticsProxyModel()
Destroys the statistics proxy model.
Definition: statisticsproxymodel.cpp:292
bool isToolTipEnabled() const
Return true if we display tooltips, otherwise false.
Definition: statisticsproxymodel.cpp:302
QAbstractItemModel * sourceModel() const
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const
const QAbstractItemModel * model() const
QVariant data(int role) const
virtual bool hasChildren(const QModelIndex &parent) const
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
QModelIndex sibling(int row, int column) const
bool hasAttribute(const QByteArray &name) const
Returns true if the entity has an attribute of the given type name, false otherwise.
Definition: entity.cpp:148
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)
void setExtraColumnsEnabled(bool enable)
Definition: statisticsproxymodel.cpp:307
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString toString() const
Attribute that provides quota information for a collection.
Definition: collectionquotaattribute.h:50
CollectionStatistics statistics() const
Returns the collection statistics of the collection.
Definition: collection.cpp:238
Attribute that stores the properties that are used to display an entity.
Definition: entitydisplayattribute.h:39
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
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:03 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:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.