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

Description

The Plot1DCanvas class contains SpecularPlotWithDataView for specular data presentation, and provides status string appearance.

Definition at line 29 of file Plot1DCanvas.h.

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

Public Slots

void onStatusString (const QString &name)
 

Public Member Functions

 Plot1DCanvas (QWidget *parent=nullptr)
 
virtual QList< QAction * > actionList ()
 
SessionItemcurrentItem ()
 
const SessionItemcurrentItem () const
 
QCustomPlot * customPlot ()
 
Plot1Dplot1D ()
 
void setItem (SessionItem *dataItemView) override
 
void setStatusLabelEnabled (bool flag)
 

Protected Member Functions

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

Private Attributes

FontScalingEventm_canvasEvent
 
SessionItemControllerm_itemController
 
Plot1Dm_plot
 
PlotStatusLabelm_statusLabel
 

Constructor & Destructor Documentation

◆ Plot1DCanvas()

Plot1DCanvas::Plot1DCanvas ( QWidget *  parent = nullptr)
explicit

Definition at line 21 of file Plot1DCanvas.cpp.

22  : SessionItemWidget(parent)
23  , m_plot(new Plot1D)
26 {
27  this->installEventFilter(m_canvasEvent);
28  auto* layout = new QVBoxLayout;
29  layout->setMargin(0);
30  layout->setSpacing(0);
31 
32  layout->addWidget(m_plot);
33  layout->addWidget(m_statusLabel);
34 
35  setLayout(layout);
36 
37  setStatusLabelEnabled(false);
38 }
Provides event filter for ScientificPlot. Its goal is to make font size adjustments on resize events.
void setStatusLabelEnabled(bool flag)
FontScalingEvent * m_canvasEvent
Definition: Plot1DCanvas.h:47
Plot1D * m_plot
Definition: Plot1DCanvas.h:46
PlotStatusLabel * m_statusLabel
Definition: Plot1DCanvas.h:48
The Plot1D class presents data of several 1D DataItems contained in a Data1DViewItem....
Definition: Plot1D.h:32
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame....
SessionItemWidget(QWidget *parent=nullptr)

References m_canvasEvent, m_plot, m_statusLabel, and setStatusLabelEnabled().

Here is the call graph for this function:

Member Function Documentation

◆ actionList()

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

◆ 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:

◆ customPlot()

QCustomPlot * Plot1DCanvas::customPlot ( )

Definition at line 51 of file Plot1DCanvas.cpp.

52 {
53  return m_plot->customPlot();
54 }
QCustomPlot * customPlot() override
Definition: Plot1D.h:44

References Plot1D::customPlot(), and m_plot.

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:

◆ onStatusString

void Plot1DCanvas::onStatusString ( const QString &  name)
slot

Definition at line 62 of file Plot1DCanvas.cpp.

63 {
65 }
void setText(const QString &text)
Definition: StatusLabel.cpp:42
QString const & name(EShape k)
Definition: particles.cpp:20

References m_statusLabel, GUI::RealSpace::Particles::name(), and StatusLabel::setText().

Here is the call graph for this function:

◆ plot1D()

Plot1D * Plot1DCanvas::plot1D ( )

Definition at line 46 of file Plot1DCanvas.cpp.

47 {
48  return m_plot;
49 }

References m_plot.

Referenced by FitComparisonWidget1D::subscribeToItem().

◆ setItem()

void Plot1DCanvas::setItem ( SessionItem dataItemView)
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 40 of file Plot1DCanvas.cpp.

41 {
42  SessionItemWidget::setItem(dataItemView);
43  m_plot->setItem(dataItemView);
44 }
virtual void setItem(SessionItem *item)

References m_plot, and SessionItemWidget::setItem().

Referenced by FitComparisonWidget1D::subscribeToItem(), and FitComparisonWidget1D::unsubscribeFromItem().

Here is the call graph for this function:

◆ setStatusLabelEnabled()

void Plot1DCanvas::setStatusLabelEnabled ( bool  flag)

Definition at line 56 of file Plot1DCanvas.cpp.

57 {
59  m_statusLabel->setHidden(!flag);
60 }
void setLabelEnabled(bool flag)
Enables/disables label. If disabled, all colorMaps are disconnected and label is hiding.

References m_statusLabel, and PlotStatusLabel::setLabelEnabled().

Referenced by Plot1DCanvas().

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_canvasEvent

FontScalingEvent* Plot1DCanvas::m_canvasEvent
private

Definition at line 47 of file Plot1DCanvas.h.

Referenced by Plot1DCanvas().

◆ m_itemController

◆ m_plot

Plot1D* Plot1DCanvas::m_plot
private

Definition at line 46 of file Plot1DCanvas.h.

Referenced by Plot1DCanvas(), customPlot(), plot1D(), and setItem().

◆ m_statusLabel

PlotStatusLabel* Plot1DCanvas::m_statusLabel
private

Definition at line 48 of file Plot1DCanvas.h.

Referenced by Plot1DCanvas(), onStatusString(), and setStatusLabelEnabled().


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