BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
instrumentpropertyeditor.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/quicksimeditor/instrumentpropertyeditor.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 
23 #include <QTreeView>
24 #include <QVBoxLayout>
25 
26 using namespace ModelView;
27 
28 namespace gui2 {
29 
30 InstrumentPropertyEditor::InstrumentPropertyEditor(QWidget* parent)
31  : QWidget(parent), m_beamPropertyEditor(new ModelView::PropertyTreeView)
32 
33 {
34  auto layout = new QVBoxLayout(this);
35  layout->addWidget(m_beamPropertyEditor);
36 }
37 
39 
41 {
42  auto instrument = models->instrumentModel()->topItem<SpecularInstrumentItem>();
43 
44  auto delegate = std::make_unique<ViewModelDelegate>();
45  delegate->setEditorFactory(std::make_unique<CustomBeamPropertyEditorFactory>(models));
46  m_beamPropertyEditor->setViewModelDelegate(std::move(delegate));
47 
50 
51  m_beamPropertyEditor->treeView()->setRootIsDecorated(true);
52  m_beamPropertyEditor->treeView()->expandAll();
53 }
54 
56 {
57  return StyleUtils::DockSizeHint();
58 }
59 
61 {
63 }
64 
65 } // namespace gui2
Defines class CLASS?
void setViewModelDelegate(std::unique_ptr< ViewModelDelegate > delegate)
Widget holding standard QTreeView and intended for displaying all properties of given SessionItem.
void setItem(SessionItem *item)
T * topItem() const
Returns top item of the given type.
Definition: sessionmodel.h:126
Main class to holds all models of GUI session.
InstrumentModel * instrumentModel()
void setModels(ApplicationModels *models)
ModelView::PropertyTreeView * m_beamPropertyEditor
Represents specular beam, contains settings of scan parameters.
Represents specular instrument.
static const std::string P_BEAM
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
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
Defines class CLASS?
Defines class CLASS?