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

rename class and sources GUI/View/Setup/MaskEditorPropertyPanel ->...

rename class and sources GUI/View/Setup/MaskEditorPropertyPanel -> GUI/View/Setup/MaskEditorToolpanel
parent d23f43e4
No related branches found
No related tags found
1 merge request!2151some classes no longer inherit from DataAccessWidget (#838)
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
#include "GUI/View/Canvas/MaskEditorCanvas.h" #include "GUI/View/Canvas/MaskEditorCanvas.h"
#include "GUI/View/Canvas/MaskEditorToolbar.h" #include "GUI/View/Canvas/MaskEditorToolbar.h"
#include "GUI/View/Scene/MaskGraphicsScene.h" #include "GUI/View/Scene/MaskGraphicsScene.h"
#include "GUI/View/Setup/MaskEditorPropertyPanel.h" #include "GUI/View/Setup/MaskEditorToolpanel.h"
#include <QSplitter> #include <QSplitter>
#include <QVBoxLayout> #include <QVBoxLayout>
MaskEditingFrame::MaskEditingFrame(QWidget* parent) MaskEditingFrame::MaskEditingFrame(QWidget* parent)
: DataAccessWidget(parent) : DataAccessWidget(parent)
, m_editorActions(new MaskEditorActions(this)) , m_editorActions(new MaskEditorActions(this))
, m_editorPropertyPanel(new MaskEditorPropertyPanel) , m_editorPropertyPanel(new MaskEditorToolpanel)
, m_editorCanvas(new MaskEditorCanvas) , m_editorCanvas(new MaskEditorCanvas)
{ {
setObjectName("MaskEditor"); setObjectName("MaskEditor");
...@@ -89,8 +89,8 @@ MaskEditingFrame::MaskEditingFrame(QWidget* parent) ...@@ -89,8 +89,8 @@ MaskEditingFrame::MaskEditingFrame(QWidget* parent)
&MaskEditorActions::onItemContextMenuRequest); &MaskEditorActions::onItemContextMenuRequest);
// context menu request is propagated from PropertyPanel to MaskEditorActions // context menu request is propagated from PropertyPanel to MaskEditorActions
connect(m_editorPropertyPanel, &MaskEditorPropertyPanel::itemContextMenuRequest, connect(m_editorPropertyPanel, &MaskEditorToolpanel::itemContextMenuRequest, m_editorActions,
m_editorActions, &MaskEditorActions::onItemContextMenuRequest); &MaskEditorActions::onItemContextMenuRequest);
} }
void MaskEditingFrame::setJobOrDatafileItem(QObject* item) void MaskEditingFrame::setJobOrDatafileItem(QObject* item)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
class MaskEditorActions; class MaskEditorActions;
class MaskEditorCanvas; class MaskEditorCanvas;
class MaskEditorPropertyPanel; class MaskEditorToolpanel;
//! Mask editing for DatafileItem on DataView. //! Mask editing for DatafileItem on DataView.
...@@ -39,7 +39,7 @@ private: ...@@ -39,7 +39,7 @@ private:
void hideEvent(QHideEvent*) override; void hideEvent(QHideEvent*) override;
MaskEditorActions* m_editorActions; MaskEditorActions* m_editorActions;
MaskEditorPropertyPanel* m_editorPropertyPanel; MaskEditorToolpanel* m_editorPropertyPanel;
MaskEditorCanvas* m_editorCanvas; MaskEditorCanvas* m_editorCanvas;
}; };
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit reflection and scattering // BornAgain: simulate and fit reflection and scattering
// //
//! @file GUI/View/Setup/MaskEditorPropertyPanel.cpp //! @file GUI/View/Setup/MaskEditorToolpanel.cpp
//! @brief Implements class MaskEditorPropertyPanel. //! @brief Implements class MaskEditorToolpanel.
//! //!
//! @homepage http://www.bornagainproject.org //! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING) //! @license GNU General Public License v3 or higher (see COPYING)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// //
// ************************************************************************************************ // ************************************************************************************************
#include "GUI/View/Setup/MaskEditorPropertyPanel.h" #include "GUI/View/Setup/MaskEditorToolpanel.h"
#include "GUI/Model/Mask/MaskContainerItem.h" #include "GUI/Model/Mask/MaskContainerItem.h"
#include "GUI/Model/Mask/MaskContainerModel.h" #include "GUI/Model/Mask/MaskContainerModel.h"
#include "GUI/Model/Mask/MaskItems.h" #include "GUI/Model/Mask/MaskItems.h"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
using std::function; using std::function;
MaskEditorPropertyPanel::MaskEditorPropertyPanel() MaskEditorToolpanel::MaskEditorToolpanel()
: m_listView(new QListView) : m_listView(new QListView)
, m_maskContainerModel(nullptr) , m_maskContainerModel(nullptr)
, m_currentMaskItem(nullptr) , m_currentMaskItem(nullptr)
...@@ -40,7 +40,7 @@ MaskEditorPropertyPanel::MaskEditorPropertyPanel() ...@@ -40,7 +40,7 @@ MaskEditorPropertyPanel::MaskEditorPropertyPanel()
m_listView->setContextMenuPolicy(Qt::CustomContextMenu); m_listView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_listView, &QListView::customContextMenuRequested, this, connect(m_listView, &QListView::customContextMenuRequested, this,
&MaskEditorPropertyPanel::onCustomContextMenuRequested); &MaskEditorToolpanel::onCustomContextMenuRequested);
auto* layout = new QVBoxLayout(this); auto* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0); layout->setContentsMargins(0, 0, 0, 0);
...@@ -62,17 +62,17 @@ MaskEditorPropertyPanel::MaskEditorPropertyPanel() ...@@ -62,17 +62,17 @@ MaskEditorPropertyPanel::MaskEditorPropertyPanel()
m_maskPropertiesLayout->setContentsMargins(0, 0, 0, 0); m_maskPropertiesLayout->setContentsMargins(0, 0, 0, 0);
} }
QSize MaskEditorPropertyPanel::sizeHint() const QSize MaskEditorToolpanel::sizeHint() const
{ {
return {128, 128}; return {128, 128};
} }
QSize MaskEditorPropertyPanel::minimumSizeHint() const QSize MaskEditorToolpanel::minimumSizeHint() const
{ {
return {128, 128}; return {128, 128};
} }
void MaskEditorPropertyPanel::setContextMPP(MaskContainerModel* containerModel) void MaskEditorToolpanel::setContextMPP(MaskContainerModel* containerModel)
{ {
m_maskContainerModel = containerModel; m_maskContainerModel = containerModel;
...@@ -81,24 +81,24 @@ void MaskEditorPropertyPanel::setContextMPP(MaskContainerModel* containerModel) ...@@ -81,24 +81,24 @@ void MaskEditorPropertyPanel::setContextMPP(MaskContainerModel* containerModel)
m_listView->setRootIndex(m_maskContainerModel->maskContItem()->rootIndex); m_listView->setRootIndex(m_maskContainerModel->maskContItem()->rootIndex);
connect(m_listView->selectionModel(), &QItemSelectionModel::selectionChanged, this, connect(m_listView->selectionModel(), &QItemSelectionModel::selectionChanged, this,
&MaskEditorPropertyPanel::onSelectionChanged, Qt::UniqueConnection); &MaskEditorToolpanel::onSelectionChanged, Qt::UniqueConnection);
} }
void MaskEditorPropertyPanel::resetContextMPP() void MaskEditorToolpanel::resetContextMPP()
{ {
m_maskContainerModel = nullptr; m_maskContainerModel = nullptr;
m_listView->setModel(nullptr); m_listView->setModel(nullptr);
setCurrentMaskItem(nullptr); setCurrentMaskItem(nullptr);
} }
QItemSelectionModel* MaskEditorPropertyPanel::selectionModel() QItemSelectionModel* MaskEditorToolpanel::selectionModel()
{ {
ASSERT(m_listView); ASSERT(m_listView);
return m_listView->selectionModel(); return m_listView->selectionModel();
} }
//! Show/Hide panel. When panel is hidden, all property editors are disabled. //! Show/Hide panel. When panel is hidden, all property editors are disabled.
void MaskEditorPropertyPanel::setPanelHidden(bool hidden) void MaskEditorToolpanel::setPanelHidden(bool hidden)
{ {
setHidden(hidden); setHidden(hidden);
...@@ -111,8 +111,7 @@ void MaskEditorPropertyPanel::setPanelHidden(bool hidden) ...@@ -111,8 +111,7 @@ void MaskEditorPropertyPanel::setPanelHidden(bool hidden)
} }
} }
void MaskEditorPropertyPanel::onSelectionChanged(const QItemSelection& selected, void MaskEditorToolpanel::onSelectionChanged(const QItemSelection& selected, const QItemSelection&)
const QItemSelection&)
{ {
if (m_inhibitSelectionChange) if (m_inhibitSelectionChange)
return; return;
...@@ -123,12 +122,12 @@ void MaskEditorPropertyPanel::onSelectionChanged(const QItemSelection& selected, ...@@ -123,12 +122,12 @@ void MaskEditorPropertyPanel::onSelectionChanged(const QItemSelection& selected,
setCurrentMaskItem(nullptr); setCurrentMaskItem(nullptr);
} }
void MaskEditorPropertyPanel::onCustomContextMenuRequested(const QPoint& point) void MaskEditorToolpanel::onCustomContextMenuRequested(const QPoint& point)
{ {
emit itemContextMenuRequest(m_listView->mapToGlobal(point)); emit itemContextMenuRequest(m_listView->mapToGlobal(point));
} }
void MaskEditorPropertyPanel::setCurrentMaskItem(MaskItem* maskItem) void MaskEditorToolpanel::setCurrentMaskItem(MaskItem* maskItem)
{ {
if (m_currentMaskItem) if (m_currentMaskItem)
disconnect(m_currentMaskItem, nullptr, this, nullptr); disconnect(m_currentMaskItem, nullptr, this, nullptr);
...@@ -140,7 +139,7 @@ void MaskEditorPropertyPanel::setCurrentMaskItem(MaskItem* maskItem) ...@@ -140,7 +139,7 @@ void MaskEditorPropertyPanel::setCurrentMaskItem(MaskItem* maskItem)
createMaskEditorUI(); createMaskEditorUI();
} }
void MaskEditorPropertyPanel::createMaskEditorUI() void MaskEditorToolpanel::createMaskEditorUI()
{ {
if (!m_currentMaskItem) if (!m_currentMaskItem)
return; return;
...@@ -210,9 +209,8 @@ void MaskEditorPropertyPanel::createMaskEditorUI() ...@@ -210,9 +209,8 @@ void MaskEditorPropertyPanel::createMaskEditorUI()
RealLimits::limitless()); RealLimits::limitless());
} }
void MaskEditorPropertyPanel::addMaskSpinBox(const QString& label, function<double()> getter, void MaskEditorToolpanel::addMaskSpinBox(const QString& label, function<double()> getter,
function<void(double)> setter, function<void(double)> setter, const RealLimits& limits)
const RealLimits& limits)
{ {
QDoubleSpinBox* spinBox = new QDoubleSpinBox; QDoubleSpinBox* spinBox = new QDoubleSpinBox;
GUI::View::NumberUtil::configSpinbox(spinBox, 3, limits); GUI::View::NumberUtil::configSpinbox(spinBox, 3, limits);
...@@ -230,8 +228,8 @@ void MaskEditorPropertyPanel::addMaskSpinBox(const QString& label, function<doub ...@@ -230,8 +228,8 @@ void MaskEditorPropertyPanel::addMaskSpinBox(const QString& label, function<doub
m_maskPropertiesLayout->addRow(label + ":", spinBox); m_maskPropertiesLayout->addRow(label + ":", spinBox);
} }
void MaskEditorPropertyPanel::addMaskCheckBox(const QString& title, function<bool()> getter, void MaskEditorToolpanel::addMaskCheckBox(const QString& title, function<bool()> getter,
function<void(bool)> setter) function<void(bool)> setter)
{ {
auto* checkBox = new QCheckBox(title, m_maskPropertiesLayout->parentWidget()); auto* checkBox = new QCheckBox(title, m_maskPropertiesLayout->parentWidget());
checkBox->setChecked(getter()); checkBox->setChecked(getter());
...@@ -248,7 +246,7 @@ void MaskEditorPropertyPanel::addMaskCheckBox(const QString& title, function<boo ...@@ -248,7 +246,7 @@ void MaskEditorPropertyPanel::addMaskCheckBox(const QString& title, function<boo
m_maskPropertiesLayout->addRow(checkBox); m_maskPropertiesLayout->addRow(checkBox);
} }
MaskItem* MaskEditorPropertyPanel::maskItemForIndex(const QModelIndex& index) MaskItem* MaskEditorToolpanel::maskItemForIndex(const QModelIndex& index)
{ {
return m_maskContainerModel->itemForIndex(index); return m_maskContainerModel->itemForIndex(index);
} }
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit reflection and scattering // BornAgain: simulate and fit reflection and scattering
// //
//! @file GUI/View/Setup/MaskEditorPropertyPanel.h //! @file GUI/View/Setup/MaskEditorToolpanel.h
//! @brief Defines class MaskEditorPropertyPanel. //! @brief Defines class MaskEditorToolpanel.
//! //!
//! @homepage http://www.bornagainproject.org //! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING) //! @license GNU General Public License v3 or higher (see COPYING)
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
// //
// ************************************************************************************************ // ************************************************************************************************
#ifndef BORNAGAIN_GUI_VIEW_SETUP_MASKEDITORPROPERTYPANEL_H #ifndef BORNAGAIN_GUI_VIEW_SETUP_MASKEDITORTOOLPANEL_H
#define BORNAGAIN_GUI_VIEW_SETUP_MASKEDITORPROPERTYPANEL_H #define BORNAGAIN_GUI_VIEW_SETUP_MASKEDITORTOOLPANEL_H
#include <QWidget> #include <QWidget>
#include <functional> #include <functional>
...@@ -30,10 +30,10 @@ class RealLimits; ...@@ -30,10 +30,10 @@ class RealLimits;
//! Tool widget for MaskEditor //! Tool widget for MaskEditor
class MaskEditorPropertyPanel : public QWidget { class MaskEditorToolpanel : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
MaskEditorPropertyPanel(); MaskEditorToolpanel();
QSize sizeHint() const override; QSize sizeHint() const override;
QSize minimumSizeHint() const override; QSize minimumSizeHint() const override;
...@@ -76,4 +76,4 @@ private: ...@@ -76,4 +76,4 @@ private:
bool m_inhibitSelectionChange = false; bool m_inhibitSelectionChange = false;
}; };
#endif // BORNAGAIN_GUI_VIEW_SETUP_MASKEDITORPROPERTYPANEL_H #endif // BORNAGAIN_GUI_VIEW_SETUP_MASKEDITORTOOLPANEL_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