marble
#include <kdescendantsproxymodel.h>

Public Member Functions | |
KDescendantsProxyModel (QObject *parent=0) | |
virtual | ~KDescendantsProxyModel () |
QString | ancestorSeparator () const |
virtual int | columnCount (const QModelIndex &index=QModelIndex()) const |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const |
int | descendantCount (const QModelIndex &index) const |
bool | displayAncestorData () const |
virtual Qt::ItemFlags | flags (const QModelIndex &index) const |
virtual bool | hasChildren (const QModelIndex &parent=QModelIndex()) const |
virtual QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
virtual QModelIndex | index (int, int, const QModelIndex &parent=QModelIndex()) const |
QModelIndex | mapFromSource (const QModelIndex &sourceIndex) const |
QModelIndex | mapToSource (const QModelIndex &proxyIndex) 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 |
virtual QMimeData * | mimeData (const QModelIndexList &indexes) const |
virtual QStringList | mimeTypes () const |
virtual QModelIndex | parent (const QModelIndex &) const |
virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
void | setAncestorSeparator (const QString &separator) |
void | setDisplayAncestorData (bool display) |
void | setRootIndex (const QModelIndex &index) |
virtual void | setSourceModel (QAbstractItemModel *model) |
virtual Qt::DropActions | supportedDropActions () const |
Detailed Description
Proxy Model for restructuring a Tree into a list.
A KDescendantsProxyModel may be used to alter how the items in the tree are presented.
Given a model which is represented as a tree:

The KDescendantsProxyModel restructures the sourceModel to represent it as a flat list.

KDescendantEntitiesProxyModel can also display the ancestors of the index in the source model as part of its display.

- Since
- 4.6
Definition at line 69 of file kdescendantsproxymodel.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new descendant entities proxy model.
- Parameters
-
parent The parent object.
Definition at line 209 of file kdescendantsproxymodel.cpp.
|
virtual |
Destroys the descendant entities proxy model.
Definition at line 214 of file kdescendantsproxymodel.cpp.
Member Function Documentation
QString KDescendantsProxyModel::ancestorSeparator | ( | ) | const |
Separator used between data of ancestors.
Definition at line 247 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 482 of file kdescendantsproxymodel.cpp.
QVariant KDescendantsProxyModel::data | ( | const QModelIndex & | index, |
int | role = Qt::DisplayRole |
||
) | const |
Definition at line 490 of file kdescendantsproxymodel.cpp.
int KDescendantsProxyModel::descendantCount | ( | const QModelIndex & | index | ) | const |
Returns the number of descendant entries for the given model index
.
bool KDescendantsProxyModel::displayAncestorData | ( | ) | const |
Whether ancestor data will be displayed.
Definition at line 235 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 530 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 329 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 522 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 349 of file kdescendantsproxymodel.cpp.
QModelIndex KDescendantsProxyModel::mapFromSource | ( | const QModelIndex & | sourceIndex | ) | const |
Definition at line 421 of file kdescendantsproxymodel.cpp.
QModelIndex KDescendantsProxyModel::mapToSource | ( | const QModelIndex & | proxyIndex | ) | const |
Definition at line 360 of file kdescendantsproxymodel.cpp.
|
virtual |
Reimplemented to match all descendants.
Definition at line 224 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 988 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 999 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 323 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 335 of file kdescendantsproxymodel.cpp.
void KDescendantsProxyModel::setAncestorSeparator | ( | const QString & | separator | ) |
Sets the ancestor separator
used between data of ancestors.
Definition at line 241 of file kdescendantsproxymodel.cpp.
void KDescendantsProxyModel::setDisplayAncestorData | ( | bool | display | ) |
Set whether to show ancestor data in the model.
If display
is true, then a source model which is displayed as
will be displayed as
If display
is false, the proxy will show
Default is false.
Definition at line 229 of file kdescendantsproxymodel.cpp.
void KDescendantsProxyModel::setRootIndex | ( | const QModelIndex & | index | ) |
Sets the root index to index
.
This is the root of the proxy model.
- Parameters
-
index The root index in the source model which will be shown in this model. If the index is invalid, the model is empty.
- Note
- You must set the model before setting the root index.
Definition at line 219 of file kdescendantsproxymodel.cpp.
|
virtual |
Sets the source model
of the proxy.
Definition at line 254 of file kdescendantsproxymodel.cpp.
|
virtual |
Definition at line 1007 of file kdescendantsproxymodel.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:38:55 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.