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

Data2DItem hold MasksSet instead of MasksQModel

parent f75022fa
No related branches found
No related tags found
1 merge request!2420mask item owned by detector instead of data
......@@ -312,18 +312,18 @@ void Data2DItem::readFrom(QXmlStreamReader* r)
MasksSet* Data2DItem::masksSet()
{
return m_model ? m_model->set() : nullptr;
return m_model.get();
}
const MasksSet* Data2DItem::masksSet() const
{
return m_model ? m_model->set() : nullptr;
return m_model.get();
}
MasksQModel* Data2DItem::getOrCreateModel()
MasksSet* Data2DItem::getOrCreateModel()
{
if (!m_model)
m_model = std::make_unique<MasksQModel>(new MasksSet);
m_model = std::make_unique<MasksSet>();
return m_model.get();
}
......
......@@ -78,7 +78,7 @@ public:
MasksSet* masksSet();
const MasksSet* masksSet() const;
MasksQModel* getOrCreateModel();
MasksSet* getOrCreateModel();
Datafield* createMaskedField() const;
MasksSet* projectionsSet();
......@@ -114,7 +114,7 @@ private:
bool m_is_interpolated;
std::unique_ptr<ComboProperty> m_gradient;
std::unique_ptr<AmplitudeAxisItem> m_z_axis;
std::unique_ptr<MasksQModel> m_model;
std::unique_ptr<MasksSet> m_model;
std::unique_ptr<MasksQModel> m_proj_model;
};
......
......@@ -15,7 +15,7 @@
#include "GUI/View/Frame/Plot2DFrame.h"
#include "Base/Util/Assert.h"
#include "GUI/Model/Data/Data2DItem.h"
#include "GUI/Model/Mask/MasksQModel.h"
#include "GUI/Model/Mask/MasksSet.h"
#include "GUI/Model/Project/ProjectDocument.h"
#include "GUI/View/Canvas/MaskEditorCanvas.h"
#include "GUI/View/Canvas/ProjectedGraphsCanvas.h"
......@@ -92,7 +92,7 @@ Plot2DFrame::Plot2DFrame(Data2DItem* item)
void Plot2DFrame::updateFrame()
{
ASSERT(m_data_item);
MasksQModel* masks_qmodel = m_data_item->getOrCreateModel();
MasksSet* masks_qmodel = m_data_item->getOrCreateModel();
ASSERT(masks_qmodel);
m_masks_panel->updateMasksPanel(masks_qmodel);
......
......@@ -15,7 +15,6 @@
#include "GUI/View/Setup/MasksPanel.h"
#include "Fit/Param/RealLimits.h"
#include "GUI/Model/Mask/MaskItems.h"
#include "GUI/Model/Mask/MasksQModel.h"
#include "GUI/Model/Mask/MasksSet.h"
#include "GUI/Model/Project/ProjectDocument.h"
#include "GUI/View/Layout/LayoutUtil.h"
......@@ -81,11 +80,11 @@ QSize MasksPanel::minimumSizeHint() const
return {128, 128};
}
void MasksPanel::updateMasksPanel(MasksQModel* masks_qmodel)
void MasksPanel::updateMasksPanel(MasksSet* masks_qmodel)
{
m_qlistmodel = masks_qmodel;
m_qlistview->setModel(m_qlistmodel);
m_qlistview->setModel(m_qlistmodel->model());
m_qlistview->setSelectionMode(QAbstractItemView::ExtendedSelection);
}
......
......@@ -25,7 +25,7 @@
class Data2DItem;
class MaskItem;
class MasksQModel;
class MasksSet;
//! Panel with list of masks and parameter editor for one selected mask.
......@@ -37,7 +37,7 @@ public:
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
void updateMasksPanel(MasksQModel* masks_qmodel);
void updateMasksPanel(MasksSet* masks_qmodel);
private:
//! Set the current mask and creates the UI to edit the mask's properties
......@@ -48,7 +48,7 @@ private:
std::function<void(bool)> setter);
QListView* m_qlistview;
MasksQModel* m_qlistmodel;
MasksSet* m_qlistmodel;
QFormLayout* m_editor_layout;
MaskItem* m_current_mask_item; //!< the mask item whose properties shall be edited
bool m_keep_selection = false;
......
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