KItemModels
kdescendantsproxymodel.h
40KDescendantEntitiesProxyModel can also display the ancestors of the index in the source model as part of its display.
55\image html descendantentitiesproxymodel-withansecnames.png "A KDescendantsProxyModel with ancestor names."
67 Q_PROPERTY(QAbstractItemModel *model READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
71 Q_PROPERTY(bool displayAncestorData READ displayAncestorData WRITE setDisplayAncestorData NOTIFY displayAncestorDataChanged)
75 Q_PROPERTY(QString ancestorSeparator READ ancestorSeparator WRITE setAncestorSeparator NOTIFY ancestorSeparatorChanged)
83 Q_PROPERTY(bool expandsByDefault READ expandsByDefault WRITE setExpandsByDefault NOTIFY expandsByDefaultChanged)
197 * @returns true if the source index is mapped in the proxy as expanded, therefore it will show its children
203 * @returns true if the source index is visible in the proxy, meaning all its parent hierarchy is expanded.
250 Q_PRIVATE_SLOT(d_func(), void sourceRowsAboutToBeMoved(const QModelIndex &, int, int, const QModelIndex &, int))
251 Q_PRIVATE_SLOT(d_func(), void sourceRowsMoved(const QModelIndex &, int, int, const QModelIndex &, int))
Proxy Model for restructuring a Tree into a list.
Definition kdescendantsproxymodel.h:61
KDescendantsProxyModel(QObject *parent=nullptr)
Creates a new descendant entities proxy model.
Definition kdescendantsproxymodel.cpp:200
~KDescendantsProxyModel() override
Destroys the descendant entities proxy model.
bool displayAncestorData
Definition kdescendantsproxymodel.h:71
void collapseSourceIndex(const QModelIndex &sourceIndex)
Maps a source index as collapsed in the proxy, all its children will be hidden.
Definition kdescendantsproxymodel.cpp:287
void setAncestorSeparator(const QString &separator)
Sets the ancestor separator used between data of ancestors.
Definition kdescendantsproxymodel.cpp:376
bool isSourceIndexExpanded(const QModelIndex &sourceIndex) const
Definition kdescendantsproxymodel.cpp:237
void expandSourceIndex(const QModelIndex &sourceIndex)
Maps a source index as expanded in the proxy, all its children will become visible.
Definition kdescendantsproxymodel.cpp:267
bool isSourceIndexVisible(const QModelIndex &sourceIndex) const
Definition kdescendantsproxymodel.cpp:249
void setDisplayAncestorData(bool display)
Set whether to show ancestor data in the model.
Definition kdescendantsproxymodel.cpp:358
bool expandsByDefault
If true, all the nodes in the whole tree will be expanded upon loading and all items of the source mo...
Definition kdescendantsproxymodel.h:83
void setExpandsByDefault(bool expand)
If true, all the nodes in the whole tree will be expanded upon loading (default)
Definition kdescendantsproxymodel.cpp:219
QString ancestorSeparator
Definition kdescendantsproxymodel.h:75
void setSourceModel(QAbstractItemModel *model) override
Sets the source model of the proxy.
Definition kdescendantsproxymodel.cpp:396
Q_SCRIPTABLE QString start(QString train="")
QAbstractItemModel(QObject *parent)
virtual int columnCount(const QModelIndex &parent) const const=0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const const
virtual int rowCount(const QModelIndex &parent) const const=0
QAbstractProxyModel(QObject *parent)
virtual QVariant data(const QModelIndex &proxyIndex, int role) const const override
virtual Qt::ItemFlags flags(const QModelIndex &index) const const override
virtual bool hasChildren(const QModelIndex &parent) const const override
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const const override
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const const=0
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const const=0
virtual QMimeData * mimeData(const QModelIndexList &indexes) const const override
virtual QStringList mimeTypes() const const override
virtual QHash< int, QByteArray > roleNames() const const override
virtual void setSourceModel(QAbstractItemModel *sourceModel)
sourceModel
virtual Qt::DropActions supportedDropActions() const const override
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
typedef DropActions
DisplayRole
typedef ItemFlags
typedef MatchFlags
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:41 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:51:41 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.