29 const auto&
childIdx = Model_->index (
row, 0, SrcIdx_);
41 if (SrcIdx_.isValid ())
52 index = index.sibling (index.row (), 0);
Base class for model items for tree-like models.
int GetRow() const
Returns the index of this item in the parent's children list.
Provides a proxying API on top of an QAbstractItemModel.
ModelItem * EnsureChild(int row)
Ensures there is a child item at the given row.
QAbstractItemModel * GetModel() const
Returns the wrapped model.
ModelItem()=default
Constructs a default (invalid) ModelItem having no model set.
void RefreshIndex(int modelStartingRow)
Updates the wrapped index so that it points at the given row.
const QModelIndex & GetIndex() const
Returns the index this ModelItem instance wraps.
ModelItem_ptr FindChild(QModelIndex index) const
Finds a child item for the given index.
Container< T > Filter(const Container< T > &c, F f)
std::shared_ptr< ModelItem > ModelItem_ptr
std::weak_ptr< ModelItem > ModelItem_wtr