Skip to content
Snippets Groups Projects
Commit a27933d8 authored by t.knopff's avatar t.knopff
Browse files

Rename InstrumentEditorWidget to InstrumentEditor

parent 01bda09f
No related branches found
No related tags found
1 merge request!279Overhaul UI: instrument view (cont.)
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit reflection and scattering // BornAgain: simulate and fit reflection and scattering
// //
//! @file GUI/Views/InstrumentWidgets/InstrumentEditorWidget.cpp //! @file GUI/Views/InstrumentWidgets/InstrumentEditor.cpp
//! @brief Implements class InstrumentEditorWidget //! @brief Implements class InstrumentEditor
//! //!
//! @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/Views/InstrumentWidgets/InstrumentEditorWidget.h" #include "GUI/Views/InstrumentWidgets/InstrumentEditor.h"
#include "GUI/Models/DetectorItems.h" #include "GUI/Models/DetectorItems.h"
#include "GUI/Models/InstrumentItems.h" #include "GUI/Models/InstrumentItems.h"
#include "GUI/Views/CommonWidgets/AdjustingScrollArea.h" #include "GUI/Views/CommonWidgets/AdjustingScrollArea.h"
...@@ -42,7 +42,7 @@ QString instrumentTypeName(InstrumentItem* instrument) ...@@ -42,7 +42,7 @@ QString instrumentTypeName(InstrumentItem* instrument)
} // namespace } // namespace
InstrumentEditorWidget::InstrumentEditorWidget(QWidget* parent) InstrumentEditor::InstrumentEditor(QWidget* parent)
: QWidget(parent) : QWidget(parent)
, m_nameLineEdit(new QLineEdit(this)) , m_nameLineEdit(new QLineEdit(this))
, m_typeLabel(new QLabel(this)) , m_typeLabel(new QLabel(this))
...@@ -65,15 +65,15 @@ InstrumentEditorWidget::InstrumentEditorWidget(QWidget* parent) ...@@ -65,15 +65,15 @@ InstrumentEditorWidget::InstrumentEditorWidget(QWidget* parent)
setLayout(mainLayout); setLayout(mainLayout);
connect(m_nameLineEdit, &QLineEdit::textChanged, this, connect(m_nameLineEdit, &QLineEdit::textChanged, this,
&InstrumentEditorWidget::onChangedEditor); &InstrumentEditor::onChangedEditor);
} }
QSize InstrumentEditorWidget::sizeHint() const QSize InstrumentEditor::sizeHint() const
{ {
return QSize(600, 600); return QSize(600, 600);
} }
void InstrumentEditorWidget::setItem(InstrumentItem* instrument) void InstrumentEditor::setItem(InstrumentItem* instrument)
{ {
m_currentItem = instrument; m_currentItem = instrument;
updateWidgets(); updateWidgets();
...@@ -81,7 +81,7 @@ void InstrumentEditorWidget::setItem(InstrumentItem* instrument) ...@@ -81,7 +81,7 @@ void InstrumentEditorWidget::setItem(InstrumentItem* instrument)
m_instrumentPresenter->setItem(instrument); m_instrumentPresenter->setItem(instrument);
} }
void InstrumentEditorWidget::onChangedEditor(const QString&) void InstrumentEditor::onChangedEditor(const QString&)
{ {
if (m_block_signals) if (m_block_signals)
return; return;
...@@ -92,7 +92,7 @@ void InstrumentEditorWidget::onChangedEditor(const QString&) ...@@ -92,7 +92,7 @@ void InstrumentEditorWidget::onChangedEditor(const QString&)
//! top block with instrument name //! top block with instrument name
QLayout* InstrumentEditorWidget::createTopLayout() QLayout* InstrumentEditor::createTopLayout()
{ {
auto result = new QFormLayout(); auto result = new QFormLayout();
...@@ -103,7 +103,7 @@ QLayout* InstrumentEditorWidget::createTopLayout() ...@@ -103,7 +103,7 @@ QLayout* InstrumentEditorWidget::createTopLayout()
return result; return result;
} }
void InstrumentEditorWidget::updateWidgets() void InstrumentEditor::updateWidgets()
{ {
m_block_signals = true; m_block_signals = true;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// //
// BornAgain: simulate and fit reflection and scattering // BornAgain: simulate and fit reflection and scattering
// //
//! @file GUI/Views/InstrumentWidgets/InstrumentEditorWidget.h //! @file GUI/Views/InstrumentWidgets/InstrumentEditor.h
//! @brief Defines class InstrumentEditorWidget //! @brief Defines class InstrumentEditor
//! //!
//! @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_VIEWS_INSTRUMENTWIDGETS_INSTRUMENTEDITORWIDGET_H #ifndef BORNAGAIN_GUI_VIEWS_INSTRUMENTWIDGETS_INSTRUMENTEDITOR_H
#define BORNAGAIN_GUI_VIEWS_INSTRUMENTWIDGETS_INSTRUMENTEDITORWIDGET_H #define BORNAGAIN_GUI_VIEWS_INSTRUMENTWIDGETS_INSTRUMENTEDITOR_H
#include <QWidget> #include <QWidget>
...@@ -26,11 +26,11 @@ class InstrumentPresenter; ...@@ -26,11 +26,11 @@ class InstrumentPresenter;
//! Main widget of InstrumentView. Contains InstrumentPresenter //! Main widget of InstrumentView. Contains InstrumentPresenter
//! showing proper insturment editor for given instrument type. //! showing proper insturment editor for given instrument type.
class InstrumentEditorWidget : public QWidget { class InstrumentEditor : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
InstrumentEditorWidget(QWidget* parent = nullptr); InstrumentEditor(QWidget* parent = nullptr);
QSize sizeHint() const; QSize sizeHint() const;
......
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include "GUI/Models/InstrumentItems.h" #include "GUI/Models/InstrumentItems.h"
#include "GUI/Models/InstrumentModel.h" #include "GUI/Models/InstrumentModel.h"
#include "GUI/Views/CommonWidgets/StyledToolBar.h" #include "GUI/Views/CommonWidgets/StyledToolBar.h"
#include "GUI/Views/InstrumentWidgets/InstrumentEditorWidget.h" #include "GUI/Views/InstrumentWidgets/InstrumentEditor.h"
#include "GUI/Views/InstrumentWidgets/InstrumentSelectorWidget.h" #include "GUI/Views/InstrumentWidgets/InstrumentSelectorWidget.h"
#include <QBoxLayout> #include <QBoxLayout>
InstrumentView::InstrumentView(QWidget* parent, InstrumentModel* instrumentModel) InstrumentView::InstrumentView(QWidget* parent, InstrumentModel* instrumentModel)
: QWidget(parent) : QWidget(parent)
, m_instrumentEditor(new ItemStackPresenter<InstrumentEditorWidget>(true)) , m_instrumentEditor(new ItemStackPresenter<InstrumentEditor>(true))
, m_instrumentModel(instrumentModel) , m_instrumentModel(instrumentModel)
{ {
auto horizontalLayout = new QHBoxLayout; auto horizontalLayout = new QHBoxLayout;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
class DetectorItem; class DetectorItem;
class InstrumentViewToolBar; class InstrumentViewToolBar;
class InstrumentSelectorWidget; class InstrumentSelectorWidget;
class InstrumentEditorWidget; class InstrumentEditor;
class InstrumentModel; class InstrumentModel;
class InstrumentView : public QWidget { class InstrumentView : public QWidget {
...@@ -38,7 +38,7 @@ protected: ...@@ -38,7 +38,7 @@ protected:
private: private:
InstrumentSelectorWidget* m_instrumentSelector; InstrumentSelectorWidget* m_instrumentSelector;
ItemStackPresenter<InstrumentEditorWidget>* m_instrumentEditor; ItemStackPresenter<InstrumentEditor>* m_instrumentEditor;
InstrumentModel* m_instrumentModel; InstrumentModel* m_instrumentModel;
}; };
......
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