|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Base class for proxy strategies in ComponentProxyModel. More...
Public Types | |
| using | map_t = QMap< QPersistentModelIndex, QPersistentModelIndex > |
Public Member Functions | |
| ProxyModelStrategy () | |
| virtual | ~ProxyModelStrategy ()=default |
| void | buildModelMap (SessionModel *source, ComponentProxyModel *proxy) |
| virtual void | onDataChanged (SessionModel *source, ComponentProxyModel *proxy) |
| const map_t & | proxySourceParent () |
| void | setRootIndex (const QModelIndex &sourceRootIndex) |
| const map_t & | sourceToProxy () |
Protected Member Functions | |
| QModelIndex | createProxyIndex (int nrow, int ncol, void *adata) |
| Method to ask proxy to create an index using friendship of ProxyModelStrategy and ComponentProxyModel. More... | |
| virtual bool | processSourceIndex (const QModelIndex &index)=0 |
| Mapping of proxy model indices to indices in source model. More... | |
Protected Attributes | |
| ComponentProxyModel * | m_proxy |
| QMap< QPersistentModelIndex, QPersistentModelIndex > | m_proxySourceParent |
| SessionModel * | m_source |
| QPersistentModelIndex | m_sourceRootIndex |
| QMap< QPersistentModelIndex, QPersistentModelIndex > | m_sourceToProxy |
| Mapping of proxy model indices to indices of parent in source model. More... | |
Base class for proxy strategies in ComponentProxyModel.
Definition at line 26 of file ProxyModelStrategy.h.
| using ProxyModelStrategy::map_t = QMap<QPersistentModelIndex, QPersistentModelIndex> |
Definition at line 28 of file ProxyModelStrategy.h.
| ProxyModelStrategy::ProxyModelStrategy | ( | ) |
Definition at line 19 of file ProxyModelStrategy.cpp.
|
virtualdefault |
| void ProxyModelStrategy::buildModelMap | ( | SessionModel * | source, |
| ComponentProxyModel * | proxy | ||
| ) |
Definition at line 21 of file ProxyModelStrategy.cpp.
References ModelUtils::iterate_if(), m_proxy, m_proxySourceParent, m_source, m_sourceRootIndex, m_sourceToProxy, and processSourceIndex().
Referenced by ComponentProxyStrategy::onDataChanged().
|
protected |
Method to ask proxy to create an index using friendship of ProxyModelStrategy and ComponentProxyModel.
Definition at line 62 of file ProxyModelStrategy.cpp.
References ASSERT, and m_proxy.
Referenced by ComponentProxyStrategy::processDefaultItem(), ComponentProxyStrategy::processGroupItem(), ComponentProxyStrategy::processRootItem(), IndentityProxyStrategy::processSourceIndex(), and ComponentProxyStrategy::processSubGroupItem().
|
virtual |
Reimplemented in ComponentProxyStrategy.
Definition at line 37 of file ProxyModelStrategy.cpp.
|
protectedpure virtual |
Mapping of proxy model indices to indices in source model.
Implemented in IndentityProxyStrategy, and ComponentProxyStrategy.
Referenced by buildModelMap().
| const ProxyModelStrategy::map_t & ProxyModelStrategy::proxySourceParent | ( | ) |
Definition at line 49 of file ProxyModelStrategy.cpp.
References m_proxySourceParent.
| void ProxyModelStrategy::setRootIndex | ( | const QModelIndex & | sourceRootIndex | ) |
Definition at line 54 of file ProxyModelStrategy.cpp.
References m_sourceRootIndex.
| const ProxyModelStrategy::map_t & ProxyModelStrategy::sourceToProxy | ( | ) |
Definition at line 44 of file ProxyModelStrategy.cpp.
References m_sourceToProxy.
|
protected |
Definition at line 52 of file ProxyModelStrategy.h.
Referenced by buildModelMap(), and createProxyIndex().
|
protected |
Definition at line 48 of file ProxyModelStrategy.h.
Referenced by buildModelMap(), ComponentProxyStrategy::processDefaultItem(), ComponentProxyStrategy::processGroupItem(), ComponentProxyStrategy::processRootItem(), IndentityProxyStrategy::processSourceIndex(), ComponentProxyStrategy::processSubGroupItem(), and proxySourceParent().
|
protected |
Definition at line 51 of file ProxyModelStrategy.h.
Referenced by buildModelMap(), and ComponentProxyStrategy::processSourceIndex().
|
protected |
Definition at line 50 of file ProxyModelStrategy.h.
Referenced by buildModelMap(), ComponentProxyStrategy::isNewRootItem(), ComponentProxyStrategy::isPropertyRelated(), and setRootIndex().
|
protected |
Mapping of proxy model indices to indices of parent in source model.
Definition at line 46 of file ProxyModelStrategy.h.
Referenced by buildModelMap(), ComponentProxyStrategy::processDefaultItem(), ComponentProxyStrategy::processGroupItem(), ComponentProxyStrategy::processRootItem(), IndentityProxyStrategy::processSourceIndex(), ComponentProxyStrategy::processSubGroupItem(), and sourceToProxy().