BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
layereditor.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/layereditor/layereditor.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
22 #include <QVBoxLayout>
23 
24 namespace gui2 {
25 
26 LayerEditor::LayerEditor(QWidget* parent)
27  : QWidget(parent)
28  , m_actions(new LayerEditorActions(this))
29  , m_editorWidget(new LayerEditorWidget(this))
30  , m_toolBar(new LayerEditorToolBar(m_actions))
31 {
32  setWindowTitle("Layer editor");
33  auto layout = new QVBoxLayout;
34  layout->addWidget(m_toolBar);
35  layout->addWidget(m_editorWidget);
36  setLayout(layout);
37  layout->setContentsMargins(0, 0, 0, 0);
38  layout->setSpacing(0);
39 }
40 
41 //! Set the mododel for the different items
43 {
44  m_actions->setModel(models->sampleModel());
45  m_editorWidget->setModels(models);
46 
47  connect(m_editorWidget->selectionModel(), &LayerSelectionModel::selectionChanged, this,
49 
51 }
52 
53 QSize LayerEditor::sizeHint() const
54 {
55  return StyleUtils::DockSizeHint();
56 }
57 
59 {
61 }
62 
64 {
65  dynamic_cast<LayerEditorToolBar*>(m_toolBar)->updateToolButtonStates(
68 }
69 
70 LayerEditor::~LayerEditor() = default;
71 
72 } // namespace gui2
Defines class CLASS?
Main class to holds all models of GUI session.
Handles user actions applied to layer tree.
void setSelectionModel(LayerSelectionModel *selection_model)
void setModel(SampleModel *model)
Layer editor toolbar.
Widget to hold layer tree (LayerTreeView) and all corresponding models and delegates.
void setModels(ApplicationModels *models)
LayerSelectionModel * selectionModel() const
QSize sizeHint() const override
Definition: layereditor.cpp:53
LayerEditorToolBar * m_toolBar
Definition: layereditor.h:50
LayerEditorWidget * m_editorWidget
Definition: layereditor.h:49
LayerEditorActions * m_actions
Definition: layereditor.h:48
void setModels(ApplicationModels *models)
Set the mododel for the different items.
Definition: layereditor.cpp:42
QSize minimumSizeHint() const override
Definition: layereditor.cpp:58
LayerEditor(QWidget *parent=nullptr)
Definition: layereditor.cpp:26
bool firstSelected() const
Checks if the first row is presen in the selection.
bool lastSelected() const
checks if the last row is present in the selection
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
DAREFLCORE_EXPORT QSize DockMinimumSizeHint()
Hint on minimum size of docks on main reflectometry window.
Definition: styleutils.cpp:34
DAREFLCORE_EXPORT QSize DockSizeHint()
Hint on size of docks on main reflectometry window.
Definition: styleutils.cpp:29
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20