65 return m_proxy->createIndex(nrow, ncol, adata);
72 QPersistentModelIndex proxyIndex =
76 QPersistentModelIndex sourceParent;
77 if (index.parent().isValid())
78 sourceParent = index.parent();
#define ASSERT(condition)
Defines class ComponentProxyModel.
Defines ModelUtils namespace.
Defines class SessionModel.
Proxy model to adjust SessionModel for component editor (right bottom corner of SampleView and simila...
bool processSourceIndex(const QModelIndex &index)
Builds one-to-one mapping for source and proxy.
const map_t & proxySourceParent()
QMap< QPersistentModelIndex, QPersistentModelIndex > m_sourceToProxy
Mapping of proxy model indices to indices of parent in source model.
QPersistentModelIndex m_sourceRootIndex
ComponentProxyModel * m_proxy
QMap< QPersistentModelIndex, QPersistentModelIndex > map_t
QMap< QPersistentModelIndex, QPersistentModelIndex > m_proxySourceParent
QModelIndex createProxyIndex(int nrow, int ncol, void *adata)
Method to ask proxy to create an index using friendship of ProxyModelStrategy and ComponentProxyModel...
const map_t & sourceToProxy()
void buildModelMap(SessionModel *source, ComponentProxyModel *proxy)
void setRootIndex(const QModelIndex &sourceRootIndex)
virtual bool processSourceIndex(const QModelIndex &index)=0
Mapping of proxy model indices to indices in source model.
virtual void onDataChanged(SessionModel *source, ComponentProxyModel *proxy)
void iterate_if(const QModelIndex &index, const QAbstractItemModel *model, const std::function< bool(const QModelIndex &)> &fun)
Iterates through all model indices and calls user function.