BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ProjectionsWidget Class Reference

Description

Holds tabs of vertical and horizontal projections, located at the bottom of ProjectionsEditor.

Definition at line 26 of file ProjectionsWidget.h.

Inheritance diagram for ProjectionsWidget:
[legend]
Collaboration diagram for ProjectionsWidget:
[legend]

Public Types

enum  ETabId { HORIZONTAL , VERTICAL }
 

Public Slots

void onActivityModeChanged (MaskEditorFlags::Activity value)
 
void onMarginsChanged (double left, double right)
 

Signals

void changeActivityRequest (MaskEditorFlags::Activity value)
 

Public Member Functions

 ProjectionsWidget (QWidget *parent=nullptr)
 
virtual QList< QAction * > actionList ()
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
void setItem (SessionItem *intensityItem) override
 

Protected Member Functions

void hideEvent (QHideEvent *) override
 
void showEvent (QShowEvent *) override
 
virtual void subscribeToItem ()
 
virtual void unsubscribeFromItem ()
 

Private Slots

void onTabChanged (int tab_index)
 

Private Member Functions

void setConnected (bool isConnected)
 

Private Attributes

SessionItemControllerm_itemController
 
QTabWidget * m_tabWidget
 
ProjectionsPlotm_xProjection
 
ProjectionsPlotm_yProjection
 

Member Enumeration Documentation

◆ ETabId

Enumerator
HORIZONTAL 
VERTICAL 

Definition at line 30 of file ProjectionsWidget.h.

Constructor & Destructor Documentation

◆ ProjectionsWidget()

ProjectionsWidget::ProjectionsWidget ( QWidget *  parent = nullptr)

Definition at line 28 of file ProjectionsWidget.cpp.

29  : SessionItemWidget(parent)
32  , m_tabWidget(new QTabWidget)
33 {
34  auto* layout = new QVBoxLayout;
35  layout->setMargin(0);
36  layout->setSpacing(0);
37 
38  m_tabWidget->setTabPosition(QTabWidget::North);
39  m_tabWidget->insertTab(HORIZONTAL, m_xProjection, "Horizontal");
40  m_tabWidget->insertTab(VERTICAL, m_yProjection, "Vertical");
41 
42  layout->addWidget(m_tabWidget);
43  setLayout(layout);
44 
45  setConnected(true);
46 }
static constexpr auto M_TYPE
Definition: MaskItems.h:147
A customplot based widget to display projections of IntensityDataItem on X,Y axes.
ProjectionsPlot * m_yProjection
void setConnected(bool isConnected)
QTabWidget * m_tabWidget
ProjectionsPlot * m_xProjection
SessionItemWidget(QWidget *parent=nullptr)
static constexpr auto M_TYPE
Definition: MaskItems.h:131

References HORIZONTAL, m_tabWidget, m_xProjection, m_yProjection, setConnected(), and VERTICAL.

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

QList< QAction * > SessionItemWidget::actionList ( )
virtualinherited

◆ changeActivityRequest

void ProjectionsWidget::changeActivityRequest ( MaskEditorFlags::Activity  value)
signal

◆ currentItem() [1/2]

◆ currentItem() [2/2]

const SessionItem * SessionItemWidget::currentItem ( ) const
inherited

Definition at line 46 of file SessionItemWidget.cpp.

47 {
48  return m_itemController->currentItem();
49 }
SessionItemController * m_itemController

References SessionItemController::currentItem(), and SessionItemWidget::m_itemController.

Here is the call graph for this function:

◆ hideEvent()

void SessionItemWidget::hideEvent ( QHideEvent *  )
overrideprotectedinherited

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals. Controller stays active to track item de...

References SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().

Here is the call graph for this function:

◆ onActivityModeChanged

void ProjectionsWidget::onActivityModeChanged ( MaskEditorFlags::Activity  value)
slot

Definition at line 55 of file ProjectionsWidget.cpp.

56 {
57  setConnected(false);
58 
60  m_tabWidget->setCurrentIndex(horizontal_projection_tab);
61  else if (value == MaskEditorFlags::VERTICAL_LINE_MODE)
62  m_tabWidget->setCurrentIndex(vertical_projection_tab);
63 
64  setConnected(true);
65 }

References MaskEditorFlags::HORIZONTAL_LINE_MODE, m_tabWidget, setConnected(), and MaskEditorFlags::VERTICAL_LINE_MODE.

Referenced by ProjectionsEditor::setup_connections().

Here is the call graph for this function:

◆ onMarginsChanged

void ProjectionsWidget::onMarginsChanged ( double  left,
double  right 
)
slot

Definition at line 67 of file ProjectionsWidget.cpp.

68 {
69  m_xProjection->onMarginsChanged(left, right);
70  m_yProjection->onMarginsChanged(left, right);
71 }
void onMarginsChanged(double left, double right)

References m_xProjection, m_yProjection, and ProjectionsPlot::onMarginsChanged().

Referenced by ProjectionsEditor::setup_connections().

Here is the call graph for this function:

◆ onTabChanged

void ProjectionsWidget::onTabChanged ( int  tab_index)
privateslot

Definition at line 73 of file ProjectionsWidget.cpp.

74 {
75  if (tab_index == horizontal_projection_tab)
77  else if (tab_index == vertical_projection_tab)
79 }
void changeActivityRequest(MaskEditorFlags::Activity value)

References changeActivityRequest(), MaskEditorFlags::HORIZONTAL_LINE_MODE, and MaskEditorFlags::VERTICAL_LINE_MODE.

Referenced by setConnected().

◆ setConnected()

void ProjectionsWidget::setConnected ( bool  isConnected)
private

Definition at line 81 of file ProjectionsWidget.cpp.

82 {
83  if (isConnected)
84  connect(m_tabWidget, &QTabWidget::currentChanged, this, &ProjectionsWidget::onTabChanged);
85  else
86  disconnect(m_tabWidget, &QTabWidget::currentChanged, this,
88 }
void onTabChanged(int tab_index)

References m_tabWidget, and onTabChanged().

Referenced by ProjectionsWidget(), and onActivityModeChanged().

Here is the call graph for this function:

◆ setItem()

void ProjectionsWidget::setItem ( SessionItem intensityItem)
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 48 of file ProjectionsWidget.cpp.

49 {
50  SessionItemWidget::setItem(intensityItem);
51  m_xProjection->setItem(intensityItem);
52  m_yProjection->setItem(intensityItem);
53 }
virtual void setItem(SessionItem *item)

References m_xProjection, m_yProjection, and SessionItemWidget::setItem().

Referenced by ProjectionsEditor::resetContext(), and ProjectionsEditor::setContext().

Here is the call graph for this function:

◆ showEvent()

void SessionItemWidget::showEvent ( QShowEvent *  )
overrideprotectedinherited

Definition at line 51 of file SessionItemWidget.cpp.

52 {
54 }
void subscribe()
Subscribe parent to item's signals.

References SessionItemWidget::m_itemController, and SessionItemController::subscribe().

Here is the call graph for this function:

◆ subscribeToItem()

◆ unsubscribeFromItem()

virtual void SessionItemWidget::unsubscribeFromItem ( )
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_itemController

◆ m_tabWidget

QTabWidget* ProjectionsWidget::m_tabWidget
private

Definition at line 50 of file ProjectionsWidget.h.

Referenced by ProjectionsWidget(), onActivityModeChanged(), and setConnected().

◆ m_xProjection

ProjectionsPlot* ProjectionsWidget::m_xProjection
private

Definition at line 48 of file ProjectionsWidget.h.

Referenced by ProjectionsWidget(), onMarginsChanged(), and setItem().

◆ m_yProjection

ProjectionsPlot* ProjectionsWidget::m_yProjection
private

Definition at line 49 of file ProjectionsWidget.h.

Referenced by ProjectionsWidget(), onMarginsChanged(), and setItem().


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