Skip to content
Snippets Groups Projects
Commit ed016b70 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

rm overdone indirection; use dedicated IntensityDataPropertyWidget instead of general approach

parent 97205c4f
No related branches found
No related tags found
1 merge request!468Refactor for cleanup
Showing with 20 additions and 107 deletions
......@@ -21,8 +21,8 @@
#include "GUI/View/Compare/FitFlowWidget.h"
#include "GUI/View/Intensity/ColorMap.h"
#include "GUI/View/Intensity/ColorMapCanvas.h"
#include "GUI/View/Intensity/IntensityDataPropertyWidget.h"
#include "GUI/View/Intensity/PlotStatusLabel.h"
#include "GUI/View/PropertyEditor/IntensityDataPropertyWidget.h"
#include <QAction>
#include <QGridLayout>
#include <QVBoxLayout>
......
......@@ -19,9 +19,9 @@
#include "GUI/Model/Job/JobItem.h"
#include "GUI/View/Compare/FitComparisonViewController.h"
#include "GUI/View/Compare/FitFlowWidget.h"
#include "GUI/View/Intensity/IntensityDataPropertyWidget.h"
#include "GUI/View/Intensity/Plot1D.h"
#include "GUI/View/Intensity/PlotStatusLabel.h"
#include "GUI/View/PropertyEditor/IntensityDataPropertyWidget.h"
#include "GUI/View/SpecularData/Plot1DCanvas.h"
#include <QAction>
#include <QGridLayout>
......
......@@ -17,7 +17,7 @@
#include "GUI/Model/Data/IntensityDataItem.h"
#include "GUI/View/Intensity/IntensityDataCanvas.h"
#include "GUI/View/Intensity/IntensityDataFFTPresenter.h"
#include "GUI/View/Intensity/IntensityDataPropertyWidget.h"
#include "GUI/View/PropertyEditor//IntensityDataPropertyWidget.h"
#include <QBoxLayout>
#include <QMenu>
......
......@@ -16,6 +16,7 @@
#include "GUI/Model/Data/IntensityDataItem.h"
#include "GUI/Model/Session/SessionModel.h"
#include "GUI/View/PropertyEditor/ComponentTreeView.h"
#include "GUI/View/PropertyEditor/IntensityDataPropertyWidget.h"
#include "GUI/View/Tool/GroupBoxCollapser.h"
#include <QGroupBox>
......@@ -26,7 +27,7 @@ MaskEditorPropertyPanel::MaskEditorPropertyPanel(QWidget* parent)
: QWidget(parent)
, m_listView(new QListView)
, m_maskPropertyEditor(new ComponentTreeView)
, m_plotPropertyEditor(new ComponentTreeView)
, m_plotPropertyEditor(new IntensityDataPropertyWidget)
, m_maskModel(nullptr)
, m_intensityDataItem(nullptr)
{
......@@ -72,8 +73,6 @@ MaskEditorPropertyPanel::MaskEditorPropertyPanel(QWidget* parent)
new QSpacerItem(0, 10, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding));
setLayout(mainLayout);
m_plotPropertyEditor->setShowHeader(false);
}
QSize MaskEditorPropertyPanel::sizeHint() const
......
......@@ -25,6 +25,7 @@ class ComponentTreeView;
class QItemSelection;
class QItemSelectionModel;
class IntensityDataItem;
class IntensityDataPropertyWidget;
//! Tool widget for MaskEditor
......@@ -55,7 +56,7 @@ private slots:
private:
QListView* m_listView;
ComponentTreeView* m_maskPropertyEditor;
ComponentTreeView* m_plotPropertyEditor;
IntensityDataPropertyWidget* m_plotPropertyEditor;
SessionModel* m_maskModel;
QModelIndex m_rootIndex;
IntensityDataItem* m_intensityDataItem;
......
......@@ -17,9 +17,9 @@
#include "GUI/Model/Session/SessionModel.h"
#include "GUI/View/Projection/ProjectionsEditorActions.h"
#include "GUI/View/Projection/ProjectionsEditorCanvas.h"
#include "GUI/View/Projection/ProjectionsPropertyPanel.h"
#include "GUI/View/Projection/ProjectionsToolBar.h"
#include "GUI/View/Projection/ProjectionsWidget.h"
#include "GUI/View/PropertyEditor/IntensityDataPropertyWidget.h"
#include <QItemSelectionModel>
#include <QSplitter>
......@@ -29,7 +29,7 @@ ProjectionsEditor::ProjectionsEditor(QWidget* parent)
, m_toolBar(new ProjectionsToolBar(m_editorActions))
, m_projectionsCanvas(new ProjectionsEditorCanvas)
, m_projectionsWidget(new ProjectionsWidget)
, m_propertyPanel(new ProjectionsPropertyPanel)
, m_propertyPanel(new IntensityDataPropertyWidget)
, m_selectionModel(nullptr)
{
addToolBar(Qt::RightToolBarArea, m_toolBar);
......
......@@ -24,9 +24,9 @@ class ProjectionsToolBar;
class ProjectionsEditorActions;
class ProjectionsActions;
class ProjectionsEditorCanvas;
class ProjectionsPropertyPanel;
class ProjectionsWidget;
class QItemSelectionModel;
class IntensityDataPropertyWidget;
//! Editor to draw projections on top of intensity plot. Part of
......@@ -50,7 +50,7 @@ private:
ProjectionsToolBar* m_toolBar; //! main tool bar with bottoms at the right
ProjectionsEditorCanvas* m_projectionsCanvas; //! canvas with color map at the top
ProjectionsWidget* m_projectionsWidget; //! bottom widget to draw projections plot
ProjectionsPropertyPanel* m_propertyPanel; //! pannel at the right with properties
IntensityDataPropertyWidget* m_propertyPanel; //! panel at the right with properties
QItemSelectionModel* m_selectionModel;
};
......
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/View/Projection/ProjectionsPropertyPanel.cpp
//! @brief Implements class ProjectionsPropertyPanel
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#include "GUI/View/Projection/ProjectionsPropertyPanel.h"
#include "GUI/View/PropertyEditor/ComponentTreeView.h"
#include <QVBoxLayout>
ProjectionsPropertyPanel::ProjectionsPropertyPanel(QWidget* parent)
: SessionItemWidget(parent), m_componentEditor(new ComponentTreeView)
{
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
auto* mainLayout = new QVBoxLayout;
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
mainLayout->addWidget(m_componentEditor);
setLayout(mainLayout);
}
QSize ProjectionsPropertyPanel::sizeHint() const
{
return QSize(230, 256);
}
QSize ProjectionsPropertyPanel::minimumSizeHint() const
{
return QSize(230, 64);
}
void ProjectionsPropertyPanel::subscribeToItem()
{
m_componentEditor->setItem(currentItem());
}
void ProjectionsPropertyPanel::unsubscribeFromItem()
{
m_componentEditor->setItem(nullptr);
}
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/View/Projection/ProjectionsPropertyPanel.h
//! @brief Defines class ProjectionsPropertyPanel
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#ifndef BORNAGAIN_GUI_VIEW_PROJECTION_PROJECTIONSPROPERTYPANEL_H
#define BORNAGAIN_GUI_VIEW_PROJECTION_PROJECTIONSPROPERTYPANEL_H
#include "GUI/View/Common/SessionItemWidget.h"
class ComponentTreeView;
class ProjectionsPropertyPanel : public SessionItemWidget {
Q_OBJECT
public:
ProjectionsPropertyPanel(QWidget* parent = nullptr);
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
protected:
void subscribeToItem() override;
void unsubscribeFromItem() override;
private:
ComponentTreeView* m_componentEditor;
};
#endif // BORNAGAIN_GUI_VIEW_PROJECTION_PROJECTIONSPROPERTYPANEL_H
......@@ -2,7 +2,7 @@
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/View/Intensity/IntensityDataPropertyWidget.cpp
//! @file GUI/View/PropertyEditor/IntensityDataPropertyWidget.cpp
//! @brief Implements class IntensityDataPropertyWidget
//!
//! @homepage http://www.bornagainproject.org
......@@ -12,7 +12,7 @@
//
// ************************************************************************************************
#include "GUI/View/Intensity/IntensityDataPropertyWidget.h"
#include "GUI/View/PropertyEditor/IntensityDataPropertyWidget.h"
#include "GUI/View/PropertyEditor/ComponentTreeView.h"
#include "GUI/View/Tool/StyleUtils.h"
#include <QAction>
......@@ -27,6 +27,8 @@ IntensityDataPropertyWidget::IntensityDataPropertyWidget(QWidget* parent)
setWindowTitle(QLatin1String("Intensity Data Properties"));
setObjectName(QLatin1String("Intensity Data Properties"));
m_componentEditor->setShowHeader(false);
auto* mainLayout = new QVBoxLayout;
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
......
......@@ -2,7 +2,7 @@
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/View/Intensity/IntensityDataPropertyWidget.h
//! @file GUI/View/PropertyEditor/IntensityDataPropertyWidget.h
//! @brief Defines class IntensityDataPropertyWidget
//!
//! @homepage http://www.bornagainproject.org
......@@ -12,8 +12,8 @@
//
// ************************************************************************************************
#ifndef BORNAGAIN_GUI_VIEW_INTENSITY_INTENSITYDATAPROPERTYWIDGET_H
#define BORNAGAIN_GUI_VIEW_INTENSITY_INTENSITYDATAPROPERTYWIDGET_H
#ifndef BORNAGAIN_GUI_VIEW_PROPERTYEDITOR_INTENSITYDATAPROPERTYWIDGET_H
#define BORNAGAIN_GUI_VIEW_PROPERTYEDITOR_INTENSITYDATAPROPERTYWIDGET_H
#include "GUI/View/Common/SessionItemWidget.h"
......@@ -46,4 +46,4 @@ private:
ComponentTreeView* m_componentEditor;
};
#endif // BORNAGAIN_GUI_VIEW_INTENSITY_INTENSITYDATAPROPERTYWIDGET_H
#endif // BORNAGAIN_GUI_VIEW_PROPERTYEDITOR_INTENSITYDATAPROPERTYWIDGET_H
......@@ -15,7 +15,7 @@
#include "GUI/View/SpecularData/SpecularDataWidget.h"
#include "GUI/Model/Data/DataItemUtils.h"
#include "GUI/Model/Data/SpecularDataItem.h"
#include "GUI/View/Intensity/IntensityDataPropertyWidget.h"
#include "GUI/View/PropertyEditor/IntensityDataPropertyWidget.h"
#include "GUI/View/SpecularData/SpecularDataCanvas.h"
#include <QBoxLayout>
#include <QMenu>
......
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