15 #ifndef BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTSTREEMODEL_H
16 #define BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTSTREEMODEL_H
18 #include <QAbstractItemModel>
42 QModelIndex
index(
int row,
int column,
43 const QModelIndex&
parent = QModelIndex())
const override;
45 QModelIndex
parent(
const QModelIndex&
index)
const override;
47 int rowCount(
const QModelIndex&
parent = QModelIndex())
const override;
48 QVariant
data(
const QModelIndex&
index,
int role = Qt::DisplayRole)
const override;
49 Qt::ItemFlags
flags(
const QModelIndex&
index)
const override;
50 bool setData(
const QModelIndex&
index,
const QVariant& value,
int role)
override;
Abstract base class for instrument-specific item classes.
Tree model for instrument item selection. Used e.g. for the instrument library.
Qt::ItemFlags flags(const QModelIndex &index) const override
void enableEmptyHeadlines(bool b)
VisibleInstrumentTypes m_visibleTypes
bool setData(const QModelIndex &index, const QVariant &value, int role) override
void refreshAfterModelChange()
static InstrumentType instrumentType(InstrumentItem *item)
QModelIndex parent(const QModelIndex &index) const override
QModelIndex indexForItem(InstrumentItem *item) const
InstrumentItem * topMostItem() const
The topmost visible item. Can be null of course.
bool m_enableEmptyHeadlines
InstrumentCollection * m_model
QList< InstrumentType > visibleTypes() const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QModelIndex indexOfHeadline(InstrumentType type) const
InstrumentItem * itemForIndex(const QModelIndex &index) const
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
InstrumentsTreeModel(QObject *parent, InstrumentCollection *model)
int columnCount(const QModelIndex &parent=QModelIndex()) const override
bool isHeadline(const QModelIndex &index) const
QVector< InstrumentItem * > instruments(InstrumentType type) const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
void setTypeEnabled(InstrumentType type, bool b)
void removeItem(InstrumentItem *item)