33 return parent.isValid () ? 0 : 1;
54 &QAbstractItemModel::rowsInserted,
56 &FlattenFilterModel::HandleRowsInserted);
58 &QAbstractItemModel::rowsAboutToBeRemoved,
60 &FlattenFilterModel::HandleRowsAboutRemoved);
62 &QAbstractItemModel::dataChanged,
64 &FlattenFilterModel::HandleDataChanged);
87 void FlattenFilterModel::HandleRowsInserted (
const QModelIndex& parent,
int start,
int end)
100 HandleRowsInserted (
child, 0,
rc - 1);
104 void FlattenFilterModel::HandleRowsAboutRemoved (
const QModelIndex& parent,
int start,
int end)
119 HandleRowsAboutRemoved (
child, 0,
rc - 1);
QModelIndex index(int, int, const QModelIndex &={}) const override
Reimplemented from QAbstractItemModel.
QList< QPersistentModelIndex > SourceIndexes_
void SetSource(QAbstractItemModel *model)
Sets the source model to model.
QAbstractItemModel * Source_
int rowCount(const QModelIndex &parent={}) const override
Reimplemented from QAbstractItemModel.
QModelIndex parent(const QModelIndex &) const override
Reimplemented from QAbstractItemModel.
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Reimplemented from QAbstractItemModel.
virtual bool IsIndexAccepted(const QModelIndex &index) const
Checks whether the given index should be included in the model.
int columnCount(const QModelIndex &parent={}) const override
Reimplemented from QAbstractItemModel.
Container< T > Filter(const Container< T > &c, F f)