BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
gui2::SimulationView Class Reference

Main simulation window with all components for quick sample editing and simulations. More...

Inheritance diagram for gui2::SimulationView:
[legend]
Collaboration diagram for gui2::SimulationView:
[legend]

Public Member Functions

 SimulationView (ApplicationModels *models, QWidget *parent=nullptr)
 

Private Member Functions

void initEditorList ()
 

Private Attributes

ModelView::CollapsibleListWidgetm_editorList {nullptr}
 
ApplicationModelsm_models {nullptr}
 
QuickSimEditorm_simEditor {nullptr}
 

Detailed Description

Main simulation window with all components for quick sample editing and simulations.

Definition at line 33 of file simulationview.h.

Constructor & Destructor Documentation

◆ SimulationView()

SimulationView::SimulationView ( ApplicationModels models,
QWidget *  parent = nullptr 
)

Definition at line 29 of file simulationview.cpp.

30  : QMainWindow(parent)
32  , m_simEditor(new QuickSimEditor)
33  , m_models(models)
34 {
35  auto splitter = new QSplitter;
36 
38 
39  splitter->addWidget(m_editorList);
40  splitter->addWidget(m_simEditor);
41 
42  setCentralWidget(splitter);
43 }
Vertical widget with column of panels displayed one under another.
ApplicationModels * m_models
QuickSimEditor * m_simEditor
ModelView::CollapsibleListWidget * m_editorList

References initEditorList(), m_editorList, and m_simEditor.

Here is the call graph for this function:

Member Function Documentation

◆ initEditorList()

void SimulationView::initEditorList ( )
private

Definition at line 45 of file simulationview.cpp.

46 {
47  m_editorList->layout()->setContentsMargins(4, 4, 4, 4);
48  auto material_editor = new MaterialEditor(this);
49  auto layer_editor = new LayerEditor(this);
50  auto sld_editor = new SLDEditor(this);
51  auto instrument_editor = new InstrumentPropertyEditor(this);
52 
53  m_editorList->addWidget(material_editor, "Material editor");
54  m_editorList->addWidget(layer_editor, "Layer editor", /*set_collapsed*/ true);
55  m_editorList->addWidget(instrument_editor, "Instrument editor", /*set_collapsed*/ true);
56  m_editorList->addWidget(sld_editor, "SLD editor", /*set_collapsed*/ true);
57 
58  material_editor->setModels(m_models);
59  layer_editor->setModels(m_models);
60  sld_editor->setModels(m_models);
62  instrument_editor->setModels(m_models);
63 }
Main widget of MaterialEditor.
void addWidget(QWidget *widget, const QString &title, bool collapsed=false)
void setModels(ApplicationModels *models)
Set the mododel for the different items.

References ModelView::CollapsibleListWidget::addWidget(), m_editorList, m_models, m_simEditor, and gui2::QuickSimEditor::setModels().

Referenced by SimulationView().

Here is the call graph for this function:

Member Data Documentation

◆ m_editorList

ModelView::CollapsibleListWidget* gui2::SimulationView::m_editorList {nullptr}
private

Definition at line 42 of file simulationview.h.

Referenced by SimulationView(), and initEditorList().

◆ m_models

ApplicationModels* gui2::SimulationView::m_models {nullptr}
private

Definition at line 44 of file simulationview.h.

Referenced by initEditorList().

◆ m_simEditor

QuickSimEditor* gui2::SimulationView::m_simEditor {nullptr}
private

Definition at line 43 of file simulationview.h.

Referenced by SimulationView(), and initEditorList().


The documentation for this class was generated from the following files: