• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

libkdepim

  • sources
  • kde-4.12
  • kdepim
  • libkdepim
  • misc
statisticsproxymodel.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 Kevin Ottens <ervin@kde.org>
3 
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #include "statisticsproxymodel.h"
22 #include <QItemSelection>
23 
24 #include <akonadi/entitytreemodel.h>
25 #include <akonadi/collectionutils_p.h>
26 
27 #include <akonadi/collectionquotaattribute.h>
28 #include <akonadi/collectionstatistics.h>
29 #include <akonadi/entitydisplayattribute.h>
30 
31 #include <kdebug.h>
32 #include <kiconloader.h>
33 #include <klocale.h>
34 #include <kio/global.h>
35 
36 #include <QApplication>
37 #include <QPalette>
38 #include <KIcon>
39 using namespace Akonadi;
40 using namespace KPIM;
41 
45 class StatisticsProxyModel::Private
46 {
47  public:
48  Private( StatisticsProxyModel *parent )
49  : mParent( parent ), mToolTipEnabled( false ), mExtraColumnsEnabled( true )
50  {
51  }
52 
53  void getCountRecursive( const QModelIndex &index, qint64 &totalSize ) const
54  {
55  Collection collection = qvariant_cast<Collection>( index.data( EntityTreeModel::CollectionRole ) );
56  // Do not assert on invalid collections, since a collection may be deleted
57  // in the meantime and deleted collections are invalid.
58  if ( collection.isValid() ) {
59  CollectionStatistics statistics = collection.statistics();
60  totalSize += qMax( 0LL, statistics.size() );
61  if ( index.model()->hasChildren( index ) ) {
62  const int rowCount = index.model()->rowCount( index );
63  for ( int row = 0; row < rowCount; row++ ) {
64  static const int column = 0;
65  getCountRecursive( index.model()->index( row, column, index ), totalSize );
66  }
67  }
68  }
69  }
70 
71  int sourceColumnCount() const
72  {
73  return mParent->sourceModel()->columnCount();
74  }
75 
76  QModelIndex sourceIndexAtFirstColumn(const QModelIndex& proxyIndex) const;
77 
78  QString toolTipForCollection( const QModelIndex &index, const Collection &collection )
79  {
80  QString bckColor = QApplication::palette().color( QPalette::ToolTipBase ).name();
81  QString txtColor = QApplication::palette().color( QPalette::ToolTipText ).name();
82 
83  QString tip = QString::fromLatin1(
84  "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\">\n"
85  );
86  const QString textDirection = ( QApplication::layoutDirection() == Qt::LeftToRight ) ? QLatin1String( "left" ) : QLatin1String( "right" );
87  tip += QString::fromLatin1(
88  " <tr>\n"
89  " <td bgcolor=\"%1\" colspan=\"2\" align=\"%4\" valign=\"middle\">\n"
90  " <div style=\"color: %2; font-weight: bold;\">\n"
91  " %3\n"
92  " </div>\n"
93  " </td>\n"
94  " </tr>\n"
95  ).arg( txtColor ).arg( bckColor ).arg( index.data( Qt::DisplayRole ).toString() ).arg( textDirection );
96 
97 
98  tip += QString::fromLatin1(
99  " <tr>\n"
100  " <td align=\"%1\" valign=\"top\">\n"
101  ).arg( textDirection );
102 
103  QString tipInfo;
104  tipInfo += QString::fromLatin1(
105  " <strong>%1</strong>: %2<br>\n"
106  " <strong>%3</strong>: %4<br><br>\n"
107  ).arg( i18n( "Total Messages" ) ).arg( collection.statistics().count() )
108  .arg( i18n( "Unread Messages" ) ).arg( collection.statistics().unreadCount() );
109 
110  if ( collection.hasAttribute<CollectionQuotaAttribute>() ) {
111  CollectionQuotaAttribute *quota = collection.attribute<CollectionQuotaAttribute>();
112  if ( quota->currentValue() > -1 && quota->maximumValue() > 0 ) {
113  qreal percentage = ( 100.0 * quota->currentValue() ) / quota->maximumValue();
114 
115  if ( qAbs( percentage ) >= 0.01 ) {
116  QString percentStr = QString::number( percentage, 'f', 2 );
117  tipInfo += QString::fromLatin1(
118  " <strong>%1</strong>: %2%<br>\n"
119  ).arg( i18n( "Quota" ) ).arg( percentStr );
120  }
121  }
122  }
123 
124  qint64 currentFolderSize( collection.statistics().size() );
125  tipInfo += QString::fromLatin1(
126  " <strong>%1</strong>: %2<br>\n"
127  ).arg( i18n( "Storage Size" ) ).arg( KIO::convertSize( (KIO::filesize_t)( currentFolderSize ) ) );
128 
129 
130  qint64 totalSize = 0;
131  getCountRecursive( index, totalSize );
132  totalSize -= currentFolderSize;
133  if (totalSize > 0 ) {
134  tipInfo += QString::fromLatin1(
135  "<strong>%1</strong>: %2<br>"
136  ).arg( i18n("Subfolder Storage Size") ).arg( KIO::convertSize( (KIO::filesize_t)( totalSize ) ) );
137  }
138 
139  QString iconName = CollectionUtils::defaultIconName( collection );
140  if ( collection.hasAttribute<EntityDisplayAttribute>() &&
141  !collection.attribute<EntityDisplayAttribute>()->iconName().isEmpty() ) {
142  if ( !collection.attribute<EntityDisplayAttribute>()->activeIconName().isEmpty() && collection.statistics().unreadCount()> 0) {
143  iconName = collection.attribute<EntityDisplayAttribute>()->activeIconName();
144  }
145  else
146  iconName = collection.attribute<EntityDisplayAttribute>()->iconName();
147  }
148 
149 
150  int iconSizes[] = { 32, 22 };
151  int icon_size_found = 32;
152 
153  QString iconPath;
154 
155  for ( int i = 0; i < 2; ++i ) {
156  iconPath = KIconLoader::global()->iconPath( iconName, -iconSizes[ i ], true );
157  if ( !iconPath.isEmpty() ) {
158  icon_size_found = iconSizes[ i ];
159  break;
160  }
161  }
162 
163  if ( iconPath.isEmpty() ) {
164  iconPath = KIconLoader::global()->iconPath( QLatin1String( "folder" ), -32, false );
165  }
166 
167  QString tipIcon = QString::fromLatin1(
168  " <table border=\"0\"><tr><td width=\"32\" height=\"32\" align=\"center\" valign=\"middle\">\n"
169  " <img src=\"%1\" width=\"%2\" height=\"32\">\n"
170  " </td></tr></table>\n"
171  " </td>\n"
172  ).arg( iconPath ).arg( icon_size_found ) ;
173 
174  if ( QApplication::layoutDirection() == Qt::LeftToRight )
175  {
176  tip += tipInfo + QString::fromLatin1( "</td><td align=\"%3\" valign=\"top\">" ).arg( textDirection ) + tipIcon;
177  }
178  else
179  {
180  tip += tipIcon + QString::fromLatin1( "</td><td align=\"%3\" valign=\"top\">" ).arg( textDirection ) + tipInfo;
181  }
182 
183 
184  tip += QString::fromLatin1(
185  " </tr>" \
186  "</table>"
187  );
188 
189  return tip;
190  }
191 
192  void proxyDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
193 
194  void sourceLayoutAboutToBeChanged();
195  void sourceLayoutChanged();
196 
197  QVector<QModelIndex> m_proxyIndexes;
198  QVector<QPersistentModelIndex> m_persistentSourceFirstColumn;
199 
200  StatisticsProxyModel *mParent;
201 
202  bool mToolTipEnabled;
203  bool mExtraColumnsEnabled;
204 };
205 
206 void StatisticsProxyModel::Private::proxyDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight)
207 {
208  if ( mExtraColumnsEnabled )
209  {
210  // Ugly hack.
211  // The proper solution is a KExtraColumnsProxyModel, but this will do for now.
212  QModelIndex parent = topLeft.parent();
213  int parentColumnCount = mParent->columnCount( parent );
214  QModelIndex extraTopLeft = mParent->index( topLeft.row(), parentColumnCount - 1 - 3 , parent );
215  QModelIndex extraBottomRight = mParent->index( bottomRight.row(), parentColumnCount -1, parent );
216  mParent->disconnect( mParent, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
217  mParent, SLOT(proxyDataChanged(QModelIndex,QModelIndex)) );
218  emit mParent->dataChanged( extraTopLeft, extraBottomRight );
219 
220  // We get this signal when the statistics of a row changes.
221  // However, we need to emit data changed for the statistics of all ancestor rows too
222  // so that recursive totals can be updated.
223  while ( parent.isValid() )
224  {
225  emit mParent->dataChanged( parent.sibling( parent.row(), parentColumnCount - 1 - 3 ),
226  parent.sibling( parent.row(), parentColumnCount - 1 ) );
227  parent = parent.parent();
228  parentColumnCount = mParent->columnCount( parent );
229  }
230  mParent->connect( mParent, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
231  SLOT(proxyDataChanged(QModelIndex,QModelIndex)) );
232  }
233 }
234 
235 void StatisticsProxyModel::Private::sourceLayoutAboutToBeChanged()
236 {
237  // KIdentityProxyModel took care of the first columnCount() columns
238  // We have to take care of the extra columns (by storing persistent indexes in column 0,
239  // waiting for the source to update them, and then looking at where they ended up)
240  QModelIndexList persistent = mParent->persistentIndexList();
241  const int columnCount = mParent->sourceModel()->columnCount();
242  foreach( const QModelIndex &proxyPersistentIndex, persistent ) {
243  if ( proxyPersistentIndex.column() >= columnCount ) {
244  m_proxyIndexes << proxyPersistentIndex;
245  m_persistentSourceFirstColumn << QPersistentModelIndex( sourceIndexAtFirstColumn( proxyPersistentIndex ) );
246  }
247  }
248 }
249 
250 void StatisticsProxyModel::Private::sourceLayoutChanged()
251 {
252  QModelIndexList oldList;
253  QModelIndexList newList;
254 
255  for( int i = 0; i < m_proxyIndexes.size(); ++i ) {
256  const QModelIndex oldProxyIndex = m_proxyIndexes.at( i );
257  const QModelIndex proxyIndexFirstCol = mParent->mapFromSource( m_persistentSourceFirstColumn.at( i ) );
258  const QModelIndex newProxyIndex = proxyIndexFirstCol.sibling( proxyIndexFirstCol.row(), oldProxyIndex.column() );
259  if ( newProxyIndex != oldProxyIndex ) {
260  oldList.append( oldProxyIndex );
261  newList.append( newProxyIndex );
262  }
263  }
264  mParent->changePersistentIndexList( oldList, newList );
265  m_persistentSourceFirstColumn.clear();
266  m_proxyIndexes.clear();
267 }
268 
269 void StatisticsProxyModel::setSourceModel(QAbstractItemModel* sourceModel)
270 {
271  // Order is important here. sourceLayoutChanged must be called *before* any downstreams react
272  // to the layoutChanged so that it can have the QPersistentModelIndexes uptodate in time.
273  disconnect(this, SIGNAL(layoutChanged()), this, SLOT(sourceLayoutChanged()));
274  connect(this, SIGNAL(layoutChanged()), SLOT(sourceLayoutChanged()));
275  KIdentityProxyModel::setSourceModel(sourceModel);
276  // This one should come *after* any downstream handlers of layoutAboutToBeChanged.
277  // The connectNotify stuff below ensures that it remains the last one.
278  disconnect(this, SIGNAL(layoutAboutToBeChanged()), this, SLOT(sourceLayoutAboutToBeChanged()));
279  connect(this, SIGNAL(layoutAboutToBeChanged()), SLOT(sourceLayoutAboutToBeChanged()));
280 }
281 
282 void StatisticsProxyModel::connectNotify(const char *signal)
283 {
284  static bool ignore = false;
285  if (ignore || QLatin1String(signal) == SIGNAL(layoutAboutToBeChanged()))
286  return KIdentityProxyModel::connectNotify(signal);
287  ignore = true;
288  disconnect(this, SIGNAL(layoutAboutToBeChanged()), this, SLOT(sourceLayoutAboutToBeChanged()));
289  connect(this, SIGNAL(layoutAboutToBeChanged()), SLOT(sourceLayoutAboutToBeChanged()));
290  ignore = false;
291  KIdentityProxyModel::connectNotify(signal);
292 }
293 
294 
295 StatisticsProxyModel::StatisticsProxyModel( QObject *parent )
296  : KIdentityProxyModel( parent ),
297  d( new Private( this ) )
298 {
299  connect( this, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
300  SLOT(proxyDataChanged(QModelIndex,QModelIndex)) );
301 }
302 
303 StatisticsProxyModel::~StatisticsProxyModel()
304 {
305  delete d;
306 }
307 
308 void StatisticsProxyModel::setToolTipEnabled( bool enable )
309 {
310  d->mToolTipEnabled = enable;
311 }
312 
313 bool StatisticsProxyModel::isToolTipEnabled() const
314 {
315  return d->mToolTipEnabled;
316 }
317 
318 void StatisticsProxyModel::setExtraColumnsEnabled( bool enable )
319 {
320  d->mExtraColumnsEnabled = enable;
321 }
322 
323 bool StatisticsProxyModel::isExtraColumnsEnabled() const
324 {
325  return d->mExtraColumnsEnabled;
326 }
327 
328 QModelIndex StatisticsProxyModel::index( int row, int column, const QModelIndex & parent ) const
329 {
330  if (!hasIndex(row, column, parent))
331  return QModelIndex();
332 
333 
334  int sourceColumn = column;
335  if ( column >= d->sourceColumnCount() ) {
336  sourceColumn = 0;
337  }
338 
339  QModelIndex i = KIdentityProxyModel::index( row, sourceColumn, parent );
340  return createIndex( i.row(), column, i.internalPointer() );
341 }
342 
343 struct SourceModelIndex
344 {
345  SourceModelIndex(int _r, int _c, void *_p, QAbstractItemModel *_m)
346  : r(_r), c(_c), p(_p), m(_m) {}
347 
348  operator QModelIndex() { return reinterpret_cast<QModelIndex&>(*this); }
349 
350  int r, c;
351  void *p;
352  const QAbstractItemModel *m;
353 };
354 
355 QModelIndex StatisticsProxyModel::Private::sourceIndexAtFirstColumn(const QModelIndex& proxyIndex) const
356 {
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());
359 }
360 
361 QModelIndex StatisticsProxyModel::parent(const QModelIndex& child) const
362 {
363  if (!sourceModel())
364  return QModelIndex();
365 
366  Q_ASSERT(child.isValid() ? child.model() == this : true);
367  if (child.column() >= d->sourceColumnCount()) {
368  // We need to get hold of the source index at column 0. But we can't do that
369  // via the proxy index at column 0, because sibling() or index() needs the
370  // parent index, and that's *exactly* what we're trying to determine here.
371  // So the only way is to create a source index ourselves.
372  const QModelIndex sourceIndex = d->sourceIndexAtFirstColumn(child);
373  const QModelIndex sourceParent = sourceIndex.parent();
374  //kDebug() << "parent of" << child.data() << "is" << sourceParent.data();
375  return mapFromSource(sourceParent);
376  } else {
377  return KIdentityProxyModel::parent(child);
378  }
379 }
380 
381 QVariant StatisticsProxyModel::data( const QModelIndex & index, int role) const
382 {
383  if (!sourceModel())
384  return QVariant();
385 
386  const int sourceColumnCount = d->sourceColumnCount();
387 
388  if ( role == Qt::DisplayRole && index.column() >= sourceColumnCount ) {
389  const QModelIndex sourceIndex = d->sourceIndexAtFirstColumn( index );
390  Collection collection = sourceModel()->data( sourceIndex, EntityTreeModel::CollectionRole ).value<Collection>();
391 
392  if ( collection.isValid() && collection.statistics().count()>=0 ) {
393  if ( index.column() == sourceColumnCount + 2 ) {
394  return KIO::convertSize( (KIO::filesize_t)( collection.statistics().size() ) );
395  } else if ( index.column() == sourceColumnCount + 1 ) {
396  return collection.statistics().count();
397  } else if ( index.column() == sourceColumnCount ) {
398  if ( collection.statistics().unreadCount() > 0 ) {
399  return collection.statistics().unreadCount();
400  } else {
401  return QString();
402  }
403  } else {
404  kWarning() << "We shouldn't get there for a column which is not total, unread or size.";
405  return QVariant();
406  }
407  }
408 
409  } else if ( role == Qt::TextAlignmentRole && index.column() >= sourceColumnCount ) {
410  return Qt::AlignRight;
411 
412  } else if ( role == Qt::ToolTipRole && d->mToolTipEnabled ) {
413  const QModelIndex sourceIndex = d->sourceIndexAtFirstColumn( index );
414  Collection collection
415  = sourceModel()->data( sourceIndex,
416  EntityTreeModel::CollectionRole ).value<Collection>();
417 
418  if ( collection.isValid() ) {
419  const QModelIndex sourceIndex = d->sourceIndexAtFirstColumn( index );
420  return d->toolTipForCollection( sourceIndex, collection );
421  }
422 
423  } else if ( role == Qt::DecorationRole && index.column() == 0 ) {
424  const QModelIndex sourceIndex = mapToSource( index );
425  Collection collection = sourceModel()->data( sourceIndex, EntityTreeModel::CollectionRole ).value<Collection>();
426  if ( collection.isValid() )
427  return KIcon( CollectionUtils::displayIconName( collection ) );
428  else
429  return QVariant();
430  }
431 
432  if ( index.column() >= sourceColumnCount )
433  return QVariant();
434 
435  return QAbstractProxyModel::data( index, role );
436 }
437 
438 QVariant StatisticsProxyModel::headerData( int section, Qt::Orientation orientation, int role) const
439 {
440  if ( orientation == Qt::Horizontal && role == Qt::DisplayRole ) {
441  if ( section == d->sourceColumnCount() + 2 ) {
442  return i18nc( "collection size", "Size" );
443  } else if ( section == d->sourceColumnCount() + 1 ) {
444  return i18nc( "number of entities in the collection", "Total" );
445  } else if ( section == d->sourceColumnCount() ) {
446  return i18nc( "number of unread entities in the collection", "Unread" );
447  }
448  }
449 
450  if ( orientation == Qt::Horizontal && section >= d->sourceColumnCount() ) {
451  return QVariant();
452  }
453 
454  return KIdentityProxyModel::headerData( section, orientation, role );
455 }
456 
457 Qt::ItemFlags StatisticsProxyModel::flags( const QModelIndex & index ) const
458 {
459  if ( index.column() >= d->sourceColumnCount() ) {
460  return KIdentityProxyModel::flags( index.sibling( index.row(), 0 ) )
461  & ( Qt::ItemIsSelectable | Qt::ItemIsDragEnabled // Allowed flags
462  | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled );
463  }
464 
465  return KIdentityProxyModel::flags( index );
466 }
467 
468 int StatisticsProxyModel::columnCount( const QModelIndex & /*parent*/ ) const
469 {
470  if ( sourceModel()==0 ) {
471  return 0;
472  } else {
473  return d->sourceColumnCount()
474  + ( d->mExtraColumnsEnabled ? 3 : 0 );
475  }
476 }
477 
478 QModelIndexList StatisticsProxyModel::match( const QModelIndex& start, int role, const QVariant& value,
479  int hits, Qt::MatchFlags flags ) const
480 {
481  if ( role < Qt::UserRole )
482  return KIdentityProxyModel::match( start, role, value, hits, flags );
483 
484  QModelIndexList list;
485  QModelIndex proxyIndex;
486  foreach ( const QModelIndex &idx, sourceModel()->match( mapToSource( start ), role, value, hits, flags ) ) {
487  proxyIndex = mapFromSource( idx );
488  if ( proxyIndex.isValid() )
489  list << proxyIndex;
490  }
491 
492  return list;
493 }
494 
495 QModelIndex StatisticsProxyModel::mapFromSource(const QModelIndex& sourceIndex) const
496 {
497  if (!sourceIndex.isValid())
498  return QModelIndex();
499  Q_ASSERT(sourceIndex.model() == sourceModel());
500  Q_ASSERT(sourceIndex.column() < d->sourceColumnCount());
501  return KIdentityProxyModel::mapFromSource(sourceIndex);
502 }
503 
504 QModelIndex StatisticsProxyModel::mapToSource(const QModelIndex& index) const
505 {
506  if (!index.isValid())
507  return QModelIndex();
508  Q_ASSERT(index.model() == this);
509  if (index.column() >= d->sourceColumnCount() ) {
510  return QModelIndex();
511  }
512  return KIdentityProxyModel::mapToSource(index);
513 }
514 
515 QModelIndex StatisticsProxyModel::buddy(const QModelIndex &index) const
516 {
517  Q_UNUSED(index);
518  return QModelIndex();
519 }
520 
521 QItemSelection StatisticsProxyModel::mapSelectionToSource(const QItemSelection& selection) const
522 {
523  QItemSelection sourceSelection;
524 
525  if (!sourceModel())
526  return sourceSelection;
527 
528  // mapToSource will give invalid index for our additional columns, so truncate the selection
529  // to the columns known by the source model
530  const int sourceColumnCount = d->sourceColumnCount();
531  QItemSelection::const_iterator it = selection.constBegin();
532  const QItemSelection::const_iterator end = selection.constEnd();
533  for ( ; it != end; ++it) {
534  Q_ASSERT(it->model() == this);
535  QModelIndex topLeft = it->topLeft();
536  Q_ASSERT(topLeft.isValid());
537  Q_ASSERT(topLeft.model() == this);
538  topLeft = topLeft.sibling(topLeft.row(), 0);
539  QModelIndex bottomRight = it->bottomRight();
540  Q_ASSERT(bottomRight.isValid());
541  Q_ASSERT(bottomRight.model() == this);
542  if (bottomRight.column() >= sourceColumnCount)
543  bottomRight = bottomRight.sibling(bottomRight.row(), sourceColumnCount-1);
544  // This can lead to duplicate source indexes, so use merge().
545  const QItemSelectionRange range(mapToSource(topLeft), mapToSource(bottomRight));
546  QItemSelection newSelection; newSelection << range;
547  sourceSelection.merge(newSelection, QItemSelectionModel::Select);
548  }
549 
550  return sourceSelection;
551 }
552 
553 #include "statisticsproxymodel.moc"
554 
KPIM::StatisticsProxyModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Definition: statisticsproxymodel.cpp:328
KIdentityProxyModel
KPIM::StatisticsProxyModel::isExtraColumnsEnabled
bool isExtraColumnsEnabled() const
Return true if we display extra statistics columns, otherwise false.
Definition: statisticsproxymodel.cpp:323
statisticsproxymodel.h
QObject
KPIM::StatisticsProxyModel::setToolTipEnabled
void setToolTipEnabled(bool enable)
Definition: statisticsproxymodel.cpp:308
KPIM::StatisticsProxyModel
A proxy model that exposes collection statistics through extra columns.
Definition: statisticsproxymodel.h:50
KPIM::StatisticsProxyModel::columnCount
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: statisticsproxymodel.cpp:468
KPIM::StatisticsProxyModel::isToolTipEnabled
bool isToolTipEnabled() const
Return true if we display tooltips, otherwise false.
Definition: statisticsproxymodel.cpp:313
KPIM::StatisticsProxyModel::match
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
KPIM::StatisticsProxyModel::headerData
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: statisticsproxymodel.cpp:438
KPIM::StatisticsProxyModel::setExtraColumnsEnabled
void setExtraColumnsEnabled(bool enable)
Definition: statisticsproxymodel.cpp:318
KPIM::StatisticsProxyModel::mapToSource
QModelIndex mapToSource(const QModelIndex &sourceIndex) const
Definition: statisticsproxymodel.cpp:504
KPIM::StatisticsProxyModel::parent
virtual QModelIndex parent(const QModelIndex &child) const
Definition: statisticsproxymodel.cpp:361
KPIM::StatisticsProxyModel::mapSelectionToSource
QItemSelection mapSelectionToSource(const QItemSelection &selection) const
Definition: statisticsproxymodel.cpp:521
KPIM::StatisticsProxyModel::~StatisticsProxyModel
virtual ~StatisticsProxyModel()
Destroys the statistics proxy model.
Definition: statisticsproxymodel.cpp:303
KPIM::StatisticsProxyModel::buddy
QModelIndex buddy(const QModelIndex &index) const
Definition: statisticsproxymodel.cpp:515
KPIM::StatisticsProxyModel::mapFromSource
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
Definition: statisticsproxymodel.cpp:495
KPIM::StatisticsProxyModel::data
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: statisticsproxymodel.cpp:381
KPIM::StatisticsProxyModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: statisticsproxymodel.cpp:457
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdepim

Skip menu "libkdepim"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal