15 #ifndef BORNAGAIN_GUI_COREGUI_MODELS_COMPONENTPROXYMODEL_H
16 #define BORNAGAIN_GUI_COREGUI_MODELS_COMPONENTPROXYMODEL_H
19 #include <QAbstractProxyModel>
21 #include <QPersistentModelIndex>
47 QModelIndex
mapToSource(
const QModelIndex& proxyIndex)
const;
48 QModelIndex
mapFromSource(
const QModelIndex& sourceIndex)
const;
50 QModelIndex
index(
int row,
int column,
const QModelIndex&
parent = {})
const;
51 QModelIndex
parent(
const QModelIndex& child)
const;
58 void sourceDataChanged(
const QModelIndex& topLeft,
const QModelIndex& bottomRight,
59 const QVector<int>& roles = {});
Defines class ProxyModelStrategy.
Proxy model to adjust SessionModel for component editor (right bottom corner of SampleView and simila...
ComponentProxyModel(QObject *parent=nullptr)
std::unique_ptr< ProxyModelStrategy > m_proxyStrategy
int rowCount(const QModelIndex &parent={}) const
QModelIndex index(int row, int column, const QModelIndex &parent={}) const
void setRootIndex(const QModelIndex &sourceRootIndex)
void setProxyStrategy(ProxyModelStrategy *strategy)
QModelIndex parent(const QModelIndex &child) const
bool hasChildren(const QModelIndex &parent) const
void buildModelMap()
Main method to build the map of persistent indeses.
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const
void sourceRowsRemoved(const QModelIndex &parent, int start, int end)
int columnCount(const QModelIndex &parent={}) const
QModelIndex mapToSource(const QModelIndex &proxyIndex) const
void setSessionModel(SessionModel *model)
void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles={})
void sourceRowsInserted(const QModelIndex &parent, int start, int end)
Base class for proxy strategies in ComponentProxyModel.