akonadi_next
#include <kreparentingproxymodel.h>
Public Member Functions | |
KReparentingProxyModel (QObject *parent=0) | |
~KReparentingProxyModel () | |
virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
virtual QVariant | data (const QModelIndex &proxyIndex, int role=Qt::DisplayRole) const |
virtual bool | hasChildren (const QModelIndex &parent=QModelIndex()) const |
virtual QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const |
virtual bool | isDescendantOf (const QModelIndex &ancestor, const QModelIndex &descendant) const |
virtual QModelIndex | mapFromSource (const QModelIndex &sourceIndex) const |
virtual QModelIndex | mapToSource (const QModelIndex &proxyIndex) const |
virtual QModelIndex | parent (const QModelIndex &child) const |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
virtual void | setSourceModel (QAbstractItemModel *sourceModel) |
virtual Qt::DropActions | supportedDropActions () const |
Detailed Description
Restructures a source model, changing the parents of items.
Subclasses can change the structure of a source model by reimplementing the isDescendantOf method.
For example, if the source model is a list,
0 - A - B - C - D - E
It could be converted to a tree by an implementation something like:
to get this result:
0 - A - - B - - - C - - D - E
Note that the implementation returns true for a query if "C" is a descendant of "A". The implementation must return the correct value for all of its descendants, not only its direct parent. The actual location to insert the descendant in the tree is determined internally by a binary find algorithm.
Definition at line 74 of file kreparentingproxymodel.h.
Constructor & Destructor Documentation
|
explicit |
Definition at line 435 of file kreparentingproxymodel.cpp.
KReparentingProxyModel::~KReparentingProxyModel | ( | ) |
Definition at line 441 of file kreparentingproxymodel.cpp.
Member Function Documentation
|
virtual |
Definition at line 566 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 583 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 692 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 588 of file kreparentingproxymodel.cpp.
|
virtual |
Reimplement this to return whether descendant
is a descendant of ancestor
.
Definition at line 463 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 470 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 503 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 619 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 671 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 697 of file kreparentingproxymodel.cpp.
|
virtual |
Definition at line 1462 of file kreparentingproxymodel.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:54:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.