Marble
kdescendantsproxymodel.cpp
3 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB a KDAB Group company <[email protected]>
125 const QPersistentModelIndex sourceIndex = q->sourceModel()->index(rowCount - 1, 0, sourceParent);
208 QModelIndexList KDescendantsProxyModel::match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const
492 QVariant KDescendantsProxyModel::headerData(int section, Qt::Orientation orientation, int role) const
512 void KDescendantsProxyModelPrivate::sourceRowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
548 void KDescendantsProxyModelPrivate::sourceRowsInserted(const QModelIndex &parent, int start, int end)
600 // The updateInternalIndexes call above will have updated the F and G mappings correctly because proxyStart is 5.
606 const QModelIndex oldIndex = q->sourceModel()->index(rowCount - 1 - difference, column, parent);
625 indexAbove = q->sourceModel()->index(q->sourceModel()->rowCount(indexAbove) - 1, column, indexAbove);
657 void KDescendantsProxyModelPrivate::sourceRowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
676 static QModelIndex getFirstDeepest(QAbstractItemModel *model, const QModelIndex &parent, int *count)
692 void KDescendantsProxyModelPrivate::sourceRowsRemoved(const QModelIndex &parent, int start, int end)
828 void KDescendantsProxyModelPrivate::sourceRowsAboutToBeMoved(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destStart)
838 void KDescendantsProxyModelPrivate::sourceRowsMoved(const QModelIndex &srcParent, int srcStart, int srcEnd, const QModelIndex &destParent, int destStart)
909 q->changePersistentIndex(m_proxyIndexes.at(i), q->mapFromSource(m_layoutChangePersistentIndexes.at(i)));
918 void KDescendantsProxyModelPrivate::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
928 const QModelIndex sourceTopLeft = q->sourceModel()->index(i, topLeft.column(), topLeft.parent());
933 const QModelIndex sourceBottomRight = q->sourceModel()->index(i, bottomRight.column(), bottomRight.parent());
virtual bool hasChildren(const QModelIndex &parent) const const
Proxy Model for restructuring a Tree into a list.
Definition: kdescendantsproxymodel.h:54
void resetInternalData()
DisplayRole
void modelReset()
virtual QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const const
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
virtual int rowCount(const QModelIndex &parent) const const=0
virtual QVariant data(const QModelIndex &proxyIndex, int role) const const override
QModelIndex sibling(int row, int column) const const
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const const=0
virtual Qt::ItemFlags flags(const QModelIndex &index) const const override
int column() const const
void layoutChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
void rowsAboutToBeInserted(const QModelIndex &parent, int start, int end)
void append(const T &value)
void push_back(const T &value)
QString & prepend(QChar ch)
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const const override
KDescendantsProxyModel(QObject *parent=nullptr)
Creates a new descendant entities proxy model.
Definition: kdescendantsproxymodel.cpp:191
bool isValid() const const
const QList< QKeySequence > & begin()
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool hasIndex(int row, int column, const QModelIndex &parent) const const
QHash::iterator insert(const Key &key, const T &value)
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const const=0
void destroyed(QObject *obj)
virtual Qt::DropActions supportedDropActions() const const override
void rowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
QVariant data(int role) const const
QModelIndex createIndex(int row, int column, void *ptr) const const
Q_SCRIPTABLE Q_NOREPLY void start()
typedef ItemFlags
void setSourceModel(QAbstractItemModel *model) override
Sets the source model of the proxy.
Definition: kdescendantsproxymodel.cpp:237
QHash::const_iterator constBegin() const const
QHash::const_iterator constEnd() const const
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
Orientation
void setRootIndex(const QModelIndex &index)
bool contains(const T &value) const const
virtual int columnCount(const QModelIndex &parent) const const=0
Binds a QML item to a specific geodetic location in screen coordinates.
Definition: AbstractDataPlugin.cpp:22
void beginResetModel()
void rowsAboutToBeMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
bool isValid() const const
int row() const const
QString ancestorSeparator() const
Separator used between data of ancestors.
Definition: kdescendantsproxymodel.cpp:231
virtual QStringList mimeTypes() const const override
void rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
typedef DropActions
void rowsInserted(const QModelIndex &parent, int first, int last)
virtual QMimeData * mimeData(const QModelIndexList &indexes) const const override
void rowsRemoved(const QModelIndex &parent, int first, int last)
bool displayAncestorData() const
Whether ancestor data will be displayed.
Definition: kdescendantsproxymodel.cpp:219
sourceModel
void clear()
QVector::iterator erase(QVector::iterator begin, QVector::iterator end)
QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const override
Reimplemented to match all descendants.
Definition: kdescendantsproxymodel.cpp:208
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
void layoutAboutToBeChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
QModelIndex parent() const const
void setDisplayAncestorData(bool display)
Set whether to show ancestor data in the model.
Definition: kdescendantsproxymodel.cpp:213
void endResetModel()
typedef MatchFlags
~KDescendantsProxyModel() override
Destroys the descendant entities proxy model.
Definition: kdescendantsproxymodel.cpp:196
QObject * parent() const const
const QAbstractItemModel * model() const const
const QList< QKeySequence > & end()
Q_D(Todo)
void setAncestorSeparator(const QString &separator)
Sets the ancestor separator used between data of ancestors.
Definition: kdescendantsproxymodel.cpp:225
void modelAboutToBeReset()
virtual void setSourceModel(QAbstractItemModel *sourceModel)
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.