13#include <QAbstractProxyModel>
36 mutable bool DefaultAcceptsRowImpl_ =
false;
45 QStack<std::function<void ()>> RemovalRefreshers_;
59 int columnCount (
const QModelIndex& = QModelIndex ())
const override;
60 QVariant
headerData (
int, Qt::Orientation,
int = Qt::DisplayRole)
const override;
61 QVariant
data (
const QModelIndex&,
int = Qt::DisplayRole)
const override;
62 Qt::ItemFlags
flags (
const QModelIndex&)
const override;
63 QModelIndex
index (
int,
int,
const QModelIndex& = QModelIndex ())
const override;
64 QModelIndex
parent (
const QModelIndex&)
const override;
65 int rowCount (
const QModelIndex& = QModelIndex ())
const override;
83 QMimeData*
mimeData (
const QModelIndexList& indices)
const override;
129 void AddModel (QAbstractItemModel *model);
143 size_t Size ()
const;
228 virtual void HandleRowsRemoved (QAbstractItemModel*,
const QModelIndex&,
int,
int);
244 virtual bool AcceptsRow (QAbstractItemModel *model,
int row)
const;
246 int RowCount (QAbstractItemModel*)
const;
QList< QAbstractItemModel * > GetAllModels() const
Returns all models intalled into this one.
QModelIndex index(int, int, const QModelIndex &=QModelIndex()) const override
const_iterator FindModel(const QAbstractItemModel *model) const
Returns a const_iterator corresponding to the passed model, or one-past-end if no such model is found...
virtual bool AcceptsRow(QAbstractItemModel *model, int row) const
Allows to filter rows from the resulting model.
QList< QPointer< QAbstractItemModel > > models_t
const_iterator GetModelForRow(int row, int *starting=nullptr) const
Returns the model for the given row.
virtual void HandleRowsAboutToBeInserted(QAbstractItemModel *, const QModelIndex &, int, int)
void AddModel(QAbstractItemModel *model)
Adds a model to the list of source models.
QMimeData * mimeData(const QModelIndexList &indices) const override
Returns the MIME data for the given indices.
virtual void HandleModelReset(QAbstractItemModel *)
size_t Size() const
Returns the number of child models in the merger.
virtual void HandleModelAboutToBeReset(QAbstractItemModel *)
virtual void setSourceModel(QAbstractItemModel *)
int GetStartingRow(const_iterator it) const
Finds starting row for the model pointed by it.
virtual void HandleRowsAboutToBeRemoved(QAbstractItemModel *, const QModelIndex &, int, int)
QModelIndex parent(const QModelIndex &) const override
virtual void HandleRowsRemoved(QAbstractItemModel *, const QModelIndex &, int, int)
virtual QModelIndex mapToSource(const QModelIndex &index) const
Returns the source model index corresponding to the given index from the sorting filter model.
void RemoveModel(QAbstractItemModel *model)
Removes a model from the list of source models.
int columnCount(const QModelIndex &=QModelIndex()) const override
int rowCount(const QModelIndex &=QModelIndex()) const override
void SetHeaders(const QStringList &headers)
Sets the new headers for this model.
Qt::ItemFlags flags(const QModelIndex &) const override
models_t::const_iterator const_iterator
virtual QModelIndex mapFromSource(const QModelIndex &index) const
Returns the model index in the MergeModel given the index from the source model.
QStringList mimeTypes() const override
Returns the union of MIME types of the models.
models_t::iterator iterator
QVariant data(const QModelIndex &, int=Qt::DisplayRole) const override
MergeModel(QStringList headers, QObject *parent=nullptr)
Constructs the merge model.
virtual void HandleRowsInserted(QAbstractItemModel *, const QModelIndex &, int, int)
QVariant headerData(int, Qt::Orientation, int=Qt::DisplayRole) const override
std::shared_ptr< ModelItem > ModelItem_ptr