41 auto ff = [=](
SessionItem* ,
const QString& property) { f(property); };
93 disconnect(
m_model, &SessionModel::rowsAboutToBeRemoved,
this,
101 connect(
m_model, &SessionModel::rowsAboutToBeRemoved,
this,
173 const QVector<int>& )
175 if (topLeft.parent() != bottomRight.parent())
195 const QString tag = parent->tagFromItem(item);
216 if (oldChild && nestling == 0)
Defines class ModelMapper.
Defines class SessionModel.
ModelMapper(QObject *parent=nullptr)
void unsubscribe(const void *caller)
Cancels all subscriptions of given caller.
void setOnAboutToRemoveChild(std::function< void(SessionItem *)> f, const void *caller=nullptr)
void onBeginRemoveRows(const QModelIndex &parent, int first, int last)
void callOnPropertyChange(const QString &name)
void onRowRemoved(const QModelIndex &parent, int first, int last)
void callOnChildPropertyChange(SessionItem *item, const QString &name)
void callOnItemDestroy()
Notifies subscribers if an item owning given mapper is about to be destroyed.
void setOnItemDestroy(std::function< void(SessionItem *)> f, const void *caller=nullptr)
void clean_container(U &v, const void *caller)
removes all callbacks related to given caller
void callOnChildrenChange(SessionItem *item)
void setOnChildrenChange(std::function< void(SessionItem *)> f, const void *caller=nullptr)
Calls back when number of children has changed, reports newChild. newChild == nullptr denotes the cas...
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles={})
std::vector< call_item_t > m_onChildrenChange
std::vector< call_t > m_onValueChange
QModelIndex m_aboutToDelete
void setItem(SessionItem *item)
void setModel(SessionModel *model)
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=nullptr)
std::vector< call_item_str_t > m_onPropertyChange
int nestlingDepth(SessionItem *item, int level=0)
std::vector< call_item_str_t > m_onChildPropertyChange
void callOnAboutToRemoveChild(SessionItem *item)
std::vector< call_item_t > m_onItemDestroy
void onRowsInserted(const QModelIndex &parent, int first, int last)
void setOnValueChange(std::function< void(void)> f, const void *caller=nullptr)
void setOnChildPropertyChange(std::function< void(SessionItem *, QString)> f, const void *caller=nullptr)
Calls back on child property change, report childItem and property name.
std::vector< call_item_t > m_onAboutToRemoveChild
Base class for a GUI data item.
SessionModel * model() const
Returns model of this item.
SessionItem * parentItem() const
Returns parent of this item.
QString tagFromItem(const SessionItem *item) const
Returns the tag name of given item when existing.
Base class for a GUI data collection. A collection is e.g. all real data (RealDataModel)....
SessionItem * itemForIndex(const QModelIndex &index) const
QModelIndex index(int row, int column, const QModelIndex &parent) const override
SessionItem * rootItem() const
QString const & name(EShape k)