Skip to content
Snippets Groups Projects
Commit 85379cfb authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

mv method and var

parent f0ef7636
No related branches found
No related tags found
1 merge request!2261merge local class TreeModel into parent class
......@@ -36,6 +36,11 @@ InstrumentsTreeModel::InstrumentsTreeModel(QObject* parent, InstrumentModel* mod
{
}
void InstrumentsTreeModel::setNewInstrument(InstrumentItem* addedInstrument)
{
m_newInstrument = addedInstrument;
}
void InstrumentsTreeModel::enableEmptyHeadlines(bool b)
{
if (b == m_enableEmptyHeadlines)
......@@ -313,11 +318,6 @@ TreeModel::TreeModel(QObject* parent, InstrumentModel* model)
{
}
void TreeModel::setNewInstrument(InstrumentItem* addedInstrument)
{
m_newInstrument = addedInstrument;
}
QVariant TreeModel::data(const QModelIndex& index, int role) const
{
if (isHeadline(index))
......
......@@ -37,6 +37,9 @@ public:
};
Q_DECLARE_FLAGS(VisibleInstrumentTypes, InstrumentType)
//! Set the instrument which shall have a "NEW" sign in its icon
void setNewInstrument(InstrumentItem* addedInstrument);
void enableEmptyHeadlines(bool b);
QModelIndex index(int row, int column,
......@@ -66,6 +69,8 @@ private:
InstrumentModel* m_model = nullptr;
bool m_namesAreEditable;
bool m_enableEmptyHeadlines;
protected: // TMP
InstrumentItem* m_newInstrument = nullptr;
};
//! A model extension for InstrumentsTreeModel which
......@@ -75,13 +80,7 @@ class TreeModel : public InstrumentsTreeModel {
public:
TreeModel(QObject* parent, InstrumentModel* model);
//! Set the instrument which shall have a "NEW" sign in its icon
void setNewInstrument(InstrumentItem* addedInstrument);
QVariant data(const QModelIndex& index, int role) const override;
private:
InstrumentItem* m_newInstrument = nullptr;
};
#endif // BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTSTREEMODEL_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment