libkdepim
statisticsproxymodel.cpp
Go to the documentation of this file.
55 Collection collection = qvariant_cast<Collection>( index.data( EntityTreeModel::CollectionRole ) );
86 const QString textDirection = ( QApplication::layoutDirection() == Qt::LeftToRight ) ? QLatin1String( "left" ) : QLatin1String( "right" );
95 ).arg( txtColor ).arg( bckColor ).arg( index.data( Qt::DisplayRole ).toString() ).arg( textDirection );
127 ).arg( i18n( "Storage Size" ) ).arg( KIO::convertSize( (KIO::filesize_t)( currentFolderSize ) ) );
136 ).arg( i18n("Subfolder Storage Size") ).arg( KIO::convertSize( (KIO::filesize_t)( totalSize ) ) );
142 if ( !collection.attribute<EntityDisplayAttribute>()->activeIconName().isEmpty() && collection.statistics().unreadCount()> 0) {
176 tip += tipInfo + QString::fromLatin1( "</td><td align=\"%3\" valign=\"top\">" ).arg( textDirection ) + tipIcon;
180 tip += tipIcon + QString::fromLatin1( "</td><td align=\"%3\" valign=\"top\">" ).arg( textDirection ) + tipInfo;
206 void StatisticsProxyModel::Private::proxyDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
215 QModelIndex extraBottomRight = mParent->index( bottomRight.row(), parentColumnCount -1, parent );
245 m_persistentSourceFirstColumn << QPersistentModelIndex( sourceIndexAtFirstColumn( proxyPersistentIndex ) );
257 const QModelIndex proxyIndexFirstCol = mParent->mapFromSource( m_persistentSourceFirstColumn.at( i ) );
258 const QModelIndex newProxyIndex = proxyIndexFirstCol.sibling( proxyIndexFirstCol.row(), oldProxyIndex.column() );
328 QModelIndex StatisticsProxyModel::index( int row, int column, const QModelIndex & parent ) const
355 QModelIndex StatisticsProxyModel::Private::sourceIndexAtFirstColumn(const QModelIndex& proxyIndex) const
357 // We rely on the fact that the internal pointer is the same for column 0 and for the extra columns
358 return SourceModelIndex(proxyIndex.row(), 0, proxyIndex.internalPointer(), mParent->sourceModel());
390 Collection collection = sourceModel()->data( sourceIndex, EntityTreeModel::CollectionRole ).value<Collection>();
425 Collection collection = sourceModel()->data( sourceIndex, EntityTreeModel::CollectionRole ).value<Collection>();
438 QVariant StatisticsProxyModel::headerData( int section, Qt::Orientation orientation, int role) const
478 QModelIndexList StatisticsProxyModel::match( const QModelIndex& start, int role, const QVariant& value,
486 foreach ( const QModelIndex &idx, sourceModel()->match( mapToSource( start ), role, value, hits, flags ) ) {
521 QItemSelection StatisticsProxyModel::mapSelectionToSource(const QItemSelection& selection) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: statisticsproxymodel.cpp:328
virtual int rowCount(const QModelIndex &parent) const =0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
Qt::LayoutDirection layoutDirection()
QString name() const
const QColor & color(ColorGroup group, ColorRole role) const
typedef MatchFlags
bool isExtraColumnsEnabled() const
Return true if we display extra statistics columns, otherwise false.
Definition: statisticsproxymodel.cpp:323
T value() const
void setToolTipEnabled(bool enable)
Definition: statisticsproxymodel.cpp:308
A proxy model that exposes collection statistics through extra columns.
Definition: statisticsproxymodel.h:50
bool isValid() const
QString number(int n, int base)
bool isEmpty() const
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: statisticsproxymodel.cpp:468
int row() const
bool isToolTipEnabled() const
Return true if we display tooltips, otherwise false.
Definition: statisticsproxymodel.cpp:313
void * internalPointer() const
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
Definition: statisticsproxymodel.cpp:478
QModelIndex parent() const
QPalette palette()
virtual QVariant data(const QModelIndex &proxyIndex, int role) const
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: statisticsproxymodel.cpp:438
void setExtraColumnsEnabled(bool enable)
Definition: statisticsproxymodel.cpp:318
const QAbstractItemModel * model() const
void merge(const QItemSelection &other, QFlags< QItemSelectionModel::SelectionFlag > command)
QModelIndex mapToSource(const QModelIndex &sourceIndex) const
Definition: statisticsproxymodel.cpp:504
QVariant data(int role) const
virtual QModelIndex parent(const QModelIndex &child) const
Definition: statisticsproxymodel.cpp:361
virtual bool hasChildren(const QModelIndex &parent) const
QModelIndex sibling(int row, int column) const
QItemSelection mapSelectionToSource(const QItemSelection &selection) const
Definition: statisticsproxymodel.cpp:521
int column() const
QString fromLatin1(const char *str, int size)
virtual ~StatisticsProxyModel()
Destroys the statistics proxy model.
Definition: statisticsproxymodel.cpp:303
const_iterator constEnd() const
const_iterator constBegin() const
QModelIndex buddy(const QModelIndex &index) const
Definition: statisticsproxymodel.cpp:515
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
Definition: statisticsproxymodel.cpp:495
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: statisticsproxymodel.cpp:381
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: statisticsproxymodel.cpp:457
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString toString() const
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:50 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:33:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.