BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
InstrumentView Class Reference
Inheritance diagram for InstrumentView:
[legend]
Collaboration diagram for InstrumentView:
[legend]

Public Slots

void onExtendedDetectorEditorRequest (DetectorItem *detectorItem)
 

Public Member Functions

 InstrumentView (MainWindow *mainWindow)
 

Protected Member Functions

void showEvent (QShowEvent *)
 

Private Slots

void onItemSelectionChanged (SessionItem *instrumentItem)
 

Private Attributes

InstrumentViewActionsm_actions
 
ItemStackPresenter< InstrumentEditorWidget > * m_instrumentEditor
 
InstrumentModelm_instrumentModel
 
InstrumentSelectorWidgetm_instrumentSelector
 
InstrumentViewToolBarm_toolBar
 

Detailed Description

Definition at line 29 of file InstrumentView.h.

Constructor & Destructor Documentation

◆ InstrumentView()

InstrumentView::InstrumentView ( MainWindow mainWindow)

Definition at line 25 of file InstrumentView.cpp.

26  : QWidget(mainWindow)
27  , m_actions(new InstrumentViewActions(this))
31  , m_instrumentModel(mainWindow->instrumentModel())
32 {
33  auto horizontalLayout = new QHBoxLayout;
34  horizontalLayout->addWidget(m_instrumentSelector);
35  horizontalLayout->addWidget(m_instrumentEditor, 1);
36 
37  auto mainLayout = new QVBoxLayout;
38  mainLayout->setMargin(0);
39  mainLayout->setSpacing(0);
40  mainLayout->addWidget(m_toolBar);
41  mainLayout->addLayout(horizontalLayout);
42  setLayout(mainLayout);
43 
47 
50 
53 }
Instrument selector on the left side of InstrumentView.
Collection of actions to add/remove/clone instrument.
void onContextMenuRequest(const QPoint &point, const QModelIndex &indexAtPoint)
void setModel(SessionModel *model)
void setSelectionModel(QItemSelectionModel *selectionModel)
Styled tool bar on top of InstrumentView with add/remove/clone instrument buttons.
InstrumentViewToolBar * m_toolBar
void onItemSelectionChanged(SessionItem *instrumentItem)
InstrumentModel * m_instrumentModel
InstrumentViewActions * m_actions
ItemStackPresenter< InstrumentEditorWidget > * m_instrumentEditor
InstrumentSelectorWidget * m_instrumentSelector
QItemSelectionModel * selectionModel()
void contextMenuRequest(const QPoint &point, const QModelIndex &index)
void setModel(SessionModel *model)
void selectionChanged(SessionItem *item)
InstrumentModel * instrumentModel()
Definition: mainwindow.cpp:139

References ItemSelectorWidget::contextMenuRequest(), m_actions, m_instrumentEditor, m_instrumentModel, m_instrumentSelector, m_toolBar, InstrumentViewActions::onContextMenuRequest(), onItemSelectionChanged(), ItemSelectorWidget::selectionChanged(), ItemSelectorWidget::selectionModel(), ItemSelectorWidget::setModel(), InstrumentViewActions::setModel(), and InstrumentViewActions::setSelectionModel().

Here is the call graph for this function:

Member Function Documentation

◆ onExtendedDetectorEditorRequest

void InstrumentView::onExtendedDetectorEditorRequest ( DetectorItem detectorItem)
slot

Definition at line 55 of file InstrumentView.cpp.

56 {
57  auto dialog = new ExtendedDetectorDialog(this);
58  dialog->setDetectorContext(m_instrumentModel, detectorItem);
59  dialog->show();
60 }
The dialog which shows a MaskEditor.

References m_instrumentModel.

◆ onItemSelectionChanged

void InstrumentView::onItemSelectionChanged ( SessionItem instrumentItem)
privateslot

Definition at line 62 of file InstrumentView.cpp.

63 {
64  m_instrumentEditor->setItem(instrumentItem);
65 }
void setItem(U *item, bool *isNew=0)
Shows the widget for given item (and hides previous one).

References m_instrumentEditor, and ItemStackPresenter< T >::setItem().

Referenced by InstrumentView().

Here is the call graph for this function:

◆ showEvent()

void InstrumentView::showEvent ( QShowEvent *  )
protected

Definition at line 67 of file InstrumentView.cpp.

68 {
70 }
void updateSelection()
select last item if no selection exists

References m_instrumentSelector, and ItemSelectorWidget::updateSelection().

Here is the call graph for this function:

Member Data Documentation

◆ m_actions

InstrumentViewActions* InstrumentView::m_actions
private

Definition at line 45 of file InstrumentView.h.

Referenced by InstrumentView().

◆ m_instrumentEditor

ItemStackPresenter<InstrumentEditorWidget>* InstrumentView::m_instrumentEditor
private

Definition at line 48 of file InstrumentView.h.

Referenced by InstrumentView(), and onItemSelectionChanged().

◆ m_instrumentModel

InstrumentModel* InstrumentView::m_instrumentModel
private

Definition at line 49 of file InstrumentView.h.

Referenced by InstrumentView(), and onExtendedDetectorEditorRequest().

◆ m_instrumentSelector

InstrumentSelectorWidget* InstrumentView::m_instrumentSelector
private

Definition at line 47 of file InstrumentView.h.

Referenced by InstrumentView(), and showEvent().

◆ m_toolBar

InstrumentViewToolBar* InstrumentView::m_toolBar
private

Definition at line 46 of file InstrumentView.h.

Referenced by InstrumentView().


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