Go to the documentation of this file.
39 #include <QAbstractItemModel>
40 #include <QStringList>
45 class TreeMergeProxyModelPrivate;
51 class TreeMergeProxyModel :
public QAbstractItemModel
55 TreeMergeProxyModelPrivate*
d_ptr;
72 QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
74 int rowCount(
const QModelIndex&
parent = QModelIndex())
const override;
77 QModelIndex
index(
int row,
int column,
const QModelIndex&
parent = QModelIndex())
const override;
78 QModelIndex
parent(
const QModelIndex&
index)
const override;
80 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
81 QVariant
data(
const QModelIndex&
index,
int role = Qt::DisplayRole)
const override;
82 bool setData(
const QModelIndex&
index,
const QVariant& value,
int role = Qt::EditRole)
override;
86 bool dropMimeData(
const QMimeData* mime, Qt::DropAction action,
int row,
int column,
87 const QModelIndex&
parent)
override;
89 bool removeRows(
int row,
int count,
const QModelIndex&
parent = QModelIndex())
override;
92 bool insertModel(
const QString& name, QAbstractItemModel* model,
int pos = -1);
95 std::pair<QAbstractItemModel*, QModelIndex>
getModel(
const QModelIndex&
index)
const;
97 int getRow(
const QAbstractItemModel* model)
const;
113 Q_PRIVATE_SLOT(d_func(),
void _q_sourceDataChanged(QModelIndex, QModelIndex, QVector<int>))
void void void void void _q_sourceRowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)) Q_PRIVATE_SLOT(d_func()
void setMimeTypes(const QStringList &mime_types)
QStringList mimeTypes() const override
bool isToplevel(const QModelIndex &index) const
return true if this index corresponds to a top-level item of an embedded model
virtual void onRemoveModel(QAbstractItemModel *model)
method called when a model is removed
TreeMergeProxyModel(QObject *parent=nullptr)
void _q_sourceRowsAboutToBeInserted(QModelIndex, int, int)) Q_PRIVATE_SLOT(d_func()
size_t modelCount() const
number of embedded models
void void void void _q_sourceRowsRemoved(QModelIndex, int, int)) Q_PRIVATE_SLOT(d_func()
bool removeModel(QAbstractItemModel *model)
remove (first) matching model
void void void void void void _q_sourceRowsMoved(QModelIndex, int, int, QModelIndex, int)) Q_PRIVATE_SLOT(d_func()
TreeMergeProxyModelPrivate * d_ptr
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
bool dropMimeData(const QMimeData *mime, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
bool insertModel(const QString &name, QAbstractItemModel *model, int pos=-1)
insert a new sub model, pos is relative to modelCount()
int getRow(const QAbstractItemModel *model) const
retrieve row index of given source model
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
void void _q_sourceRowsInserted(QModelIndex, int, int)) Q_PRIVATE_SLOT(d_func()
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Q_PRIVATE_SLOT(d_func(), void _q_sourceDestroyed(QObject *)) Q_PRIVATE_SLOT(d_func()
QModelIndex parent(const QModelIndex &index) const override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
~TreeMergeProxyModel() override
Qt::ItemFlags flags(const QModelIndex &index) const override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
bool isGroupItem(const QModelIndex &index) const
return true if this index corresponds to an embedded model's grouping item
void void void _q_sourceRowsAboutToBeRemoved(QModelIndex, int, int)) Q_PRIVATE_SLOT(d_func()
std::pair< QAbstractItemModel *, QModelIndex > getModel(const QModelIndex &index) const
retrieve source model and source index corresponding to given proxy index
visualization
Author(s): Robert Haschke
autogenerated on Sat May 3 2025 02:40:38