BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
materialeditor.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/materialeditor/materialeditor.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 
27  : QWidget(parent)
28  , m_actions(new MaterialEditorActions(this))
29  , m_editorWidget(new MaterialEditorWidget)
30  , m_toolBar(new MaterialEditorToolBar(m_actions))
31 {
32  setWindowTitle("Material 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_editorWidget->setModels(models);
45  m_actions->setModel(models->materialModel());
47 }
48 
50 {
51  return StyleUtils::DockSizeHint();
52 }
53 
55 {
57 }
58 
60 
61 } // namespace gui2
Defines class CLASS?
Main class to holds all models of GUI session.
MaterialModel * materialModel()
Handles user actions applied to material table.
void setMaterialSelectionModel(MaterialSelectionModel *selection_model)
void setModel(MaterialModel *model)
Material editor toolbar.
Widget to hold material table (MaterialTreeView) and all corresponding models and delegates.
MaterialSelectionModel * selectionModel() const
void setModels(ApplicationModels *models)
MaterialEditor(QWidget *parent=nullptr)
void setModels(ApplicationModels *models)
Set the mododel for the different items.
QSize minimumSizeHint() const override
MaterialEditorToolBar * m_toolBar
MaterialEditorWidget * m_editorWidget
MaterialEditorActions * m_actions
QSize sizeHint() const override
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