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

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

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

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

Private Attributes

FontScalingEventm_canvasEvent
 
SessionItemControllerm_itemController
 
Plot1Dm_plot
 
PlotStatusLabelm_statusLabel
 

Detailed Description

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

Definition at line 29 of file Plot1DCanvas.h.

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  QVBoxLayout* 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.
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=0)

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]

SessionItem * SessionItemWidget::currentItem ( )
inherited

Definition at line 41 of file SessionItemWidget.cpp.

42 {
43  return const_cast<SessionItem*>(static_cast<const SessionItemWidget*>(this)->currentItem());
44 }
The SessionItemWidget class is a base for all widgets representing the content of SessionItem.
SessionItem * currentItem()

Referenced by RectangularDetectorEditor::detectorItem(), SphericalDetectorEditor::detectorItem(), FitFlowWidget::fitSuiteItem(), DistributionEditor::groupItem(), DepthProbeInstrumentEditor::instrumentItem(), EnvironmentEditor::instrumentItem(), GISASBeamEditor::instrumentItem(), GISASDetectorEditor::instrumentItem(), GISASInstrumentEditor::instrumentItem(), OffSpecularBeamEditor::instrumentItem(), OffSpecularInstrumentEditor::instrumentItem(), PolarizationAnalysisEditor::instrumentItem(), SpecularBeamEditor::instrumentItem(), SpecularInstrumentEditor::instrumentItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), IntensityDataProjectionsWidget::intensityDataItem(), IntensityDataWidget::intensityDataItem(), ProjectionsPlot::intensityItem(), ColorMap::intensityItem(), DetectorPresenter::itemPresentation(), InstrumentPresenter::itemPresentation(), JobResultsPresenter::itemPresentation(), FitComparisonWidget::jobItem(), FitComparisonWidget1D::jobItem(), FitParameterWidget::jobItem(), RunFitControlWidget::jobItem(), JobPropertiesWidget::jobItem(), ParameterTuningWidget::jobItem(), SpecularDataImportWidget::realDataItem(), ItemComboWidget::setPresentation(), JobResultsPresenter::setPresentation(), SpecularDataCanvas::specularDataItem(), SpecularDataImportWidget::specularDataItem(), SpecularDataWidget::specularDataItem(), SpecularPlot::specularItem(), ItemComboWidget::subscribeToItem(), DistributionEditor::subscribeToItem(), GISASDetectorEditor::subscribeToItem(), PolarizationAnalysisEditor::subscribeToItem(), IntensityDataPropertyWidget::subscribeToItem(), JobPropertiesWidget::subscribeToItem(), ProjectionsPropertyPanel::subscribeToItem(), ProjectionsPlot::unsubscribeFromChildren(), and Plot1D::viewItem().

◆ 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 *  )
protectedvirtualinherited

Definition at line 56 of file SessionItemWidget.cpp.

57 {
59 }
void unsubscribe()
Fully unsubscribes the parent from listening item's signals.

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:39
QString const & name(EShape k)
Definition: particles.cpp:21

References m_statusLabel, 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 *  )
protectedvirtualinherited

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()

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: