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

class out of class

parent 7337ba1d
No related branches found
No related tags found
1 merge request!2261merge local class TreeModel into parent class
......@@ -298,17 +298,17 @@ void InstrumentLibraryEditor::onInstrumentChangedByEditor()
/*********************************************************************************************/
InstrumentLibraryEditor::TreeModel::TreeModel(QObject* parent, InstrumentModel* model)
TreeModel::TreeModel(QObject* parent, InstrumentModel* model)
: InstrumentsTreeModel(parent, model)
{
}
void InstrumentLibraryEditor::TreeModel::setNewInstrument(InstrumentItem* addedInstrument)
void TreeModel::setNewInstrument(InstrumentItem* addedInstrument)
{
m_newInstrument = addedInstrument;
}
QVariant InstrumentLibraryEditor::TreeModel::data(const QModelIndex& index, int role) const
QVariant TreeModel::data(const QModelIndex& index, int role) const
{
if (isHeadline(index))
return InstrumentsTreeModel::data(index, role);
......
......@@ -25,6 +25,23 @@
class InstrumentItem;
class InstrumentLibrary;
//! A model extension for InstrumentsTreeModel which
//! * shows a "NEW" sign in the icon of a newly added instrument.
//! * creates a HTML text for the Display role
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;
};
class InstrumentLibraryEditor : public QDialog {
Q_OBJECT
public:
......@@ -51,22 +68,6 @@ private:
void applySplitterPos();
void saveSplitterPos();
//! A model extension for InstrumentsTreeModel which
//! * shows a "NEW" sign in the icon of a newly added instrument.
//! * creates a HTML text for the Display role
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;
};
InstrumentLibrary* m_instrumentLibrary;
TreeModel* m_treeModel;
InstrumentItem* m_chosenItem;
......
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