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

Layer editor. More...

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

Public Member Functions

 LayerEditor (QWidget *parent=nullptr)
 
 ~LayerEditor ()
 
QSize minimumSizeHint () const override
 
void selectionChanged ()
 
void setModels (ApplicationModels *models)
 Set the mododel for the different items. More...
 
QSize sizeHint () const override
 

Private Attributes

LayerEditorActionsm_actions {nullptr}
 
LayerEditorWidgetm_editorWidget {nullptr}
 
LayerEditorToolBarm_toolBar {nullptr}
 

Detailed Description

Layer editor.

Definition at line 34 of file layereditor.h.

Constructor & Destructor Documentation

◆ LayerEditor()

gui2::LayerEditor::LayerEditor ( QWidget *  parent = nullptr)

Definition at line 26 of file layereditor.cpp.

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 }
LayerEditorToolBar * m_toolBar
Definition: layereditor.h:50
LayerEditorWidget * m_editorWidget
Definition: layereditor.h:49
LayerEditorActions * m_actions
Definition: layereditor.h:48

References m_editorWidget, and m_toolBar.

◆ ~LayerEditor()

gui2::LayerEditor::~LayerEditor ( )
default

Member Function Documentation

◆ minimumSizeHint()

QSize gui2::LayerEditor::minimumSizeHint ( ) const
override

Definition at line 58 of file layereditor.cpp.

59 {
61 }
DAREFLCORE_EXPORT QSize DockMinimumSizeHint()
Hint on minimum size of docks on main reflectometry window.
Definition: styleutils.cpp:34

References gui2::StyleUtils::DockMinimumSizeHint().

Here is the call graph for this function:

◆ selectionChanged()

void gui2::LayerEditor::selectionChanged ( )

Definition at line 63 of file layereditor.cpp.

64 {
65  dynamic_cast<LayerEditorToolBar*>(m_toolBar)->updateToolButtonStates(
68 }
LayerSelectionModel * selectionModel() const
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

References gui2::LayerSelectionModel::firstSelected(), gui2::LayerSelectionModel::lastSelected(), m_editorWidget, m_toolBar, and gui2::LayerEditorWidget::selectionModel().

Referenced by setModels().

Here is the call graph for this function:

◆ setModels()

void gui2::LayerEditor::setModels ( ApplicationModels models)

Set the mododel for the different items.

Definition at line 42 of file layereditor.cpp.

43 {
44  m_actions->setModel(models->sampleModel());
45  m_editorWidget->setModels(models);
46 
47  connect(m_editorWidget->selectionModel(), &LayerSelectionModel::selectionChanged, this,
49 
51 }
SampleModel * sampleModel()
void setSelectionModel(LayerSelectionModel *selection_model)
void setModel(SampleModel *model)
void setModels(ApplicationModels *models)

References m_actions, m_editorWidget, gui2::ApplicationModels::sampleModel(), selectionChanged(), gui2::LayerEditorWidget::selectionModel(), gui2::LayerEditorActions::setModel(), gui2::LayerEditorWidget::setModels(), and gui2::LayerEditorActions::setSelectionModel().

Here is the call graph for this function:

◆ sizeHint()

QSize gui2::LayerEditor::sizeHint ( ) const
override

Definition at line 53 of file layereditor.cpp.

54 {
55  return StyleUtils::DockSizeHint();
56 }
DAREFLCORE_EXPORT QSize DockSizeHint()
Hint on size of docks on main reflectometry window.
Definition: styleutils.cpp:29

References gui2::StyleUtils::DockSizeHint().

Here is the call graph for this function:

Member Data Documentation

◆ m_actions

LayerEditorActions* gui2::LayerEditor::m_actions {nullptr}
private

Definition at line 48 of file layereditor.h.

Referenced by setModels().

◆ m_editorWidget

LayerEditorWidget* gui2::LayerEditor::m_editorWidget {nullptr}
private

Definition at line 49 of file layereditor.h.

Referenced by LayerEditor(), selectionChanged(), and setModels().

◆ m_toolBar

LayerEditorToolBar* gui2::LayerEditor::m_toolBar {nullptr}
private

Definition at line 50 of file layereditor.h.

Referenced by LayerEditor(), and selectionChanged().


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