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

The SpecularPlotCanvas class contains SpecularPlot for specular data presentation, and provides status string appearance. More...

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

Public Slots

void onStatusString (const QString &name)
 

Public Member Functions

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

Protected Member Functions

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

Private Attributes

FontScalingEventm_canvasEvent
 
SessionItemControllerm_itemController
 
SpecularPlotm_plot
 
PlotStatusLabelm_statusLabel
 

Detailed Description

The SpecularPlotCanvas class contains SpecularPlot for specular data presentation, and provides status string appearance.

Definition at line 28 of file SpecularPlotCanvas.h.

Constructor & Destructor Documentation

◆ SpecularPlotCanvas()

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

Definition at line 22 of file SpecularPlotCanvas.cpp.

23  : SessionItemWidget(parent)
24  , m_plot(new SpecularPlot)
27 {
28  this->installEventFilter(m_canvasEvent);
29  QVBoxLayout* layout = new QVBoxLayout;
30  layout->setMargin(0);
31  layout->setSpacing(0);
32 
33  layout->addWidget(m_plot);
34  layout->addWidget(m_statusLabel);
35 
36  setLayout(layout);
37 
38  setStatusLabelEnabled(false);
39 }
Provides event filter for ScientificPlot.
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame.
SessionItemWidget(QWidget *parent=0)
FontScalingEvent * m_canvasEvent
PlotStatusLabel * m_statusLabel
void setStatusLabelEnabled(bool flag)
SpecularPlot * m_plot
The SpecularPlot class presents 1D intensity data from SpecularDataItem.
Definition: SpecularPlot.h:32

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 * SpecularPlotCanvas::customPlot ( )

Definition at line 52 of file SpecularPlotCanvas.cpp.

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

References SpecularPlot::customPlot(), and m_plot.

Referenced by SpecularDataCanvas::customPlot(), SpecularDataCanvas::enableDeprecatedOnMousePress(), and SpecularDataCanvas::onSavePlotAction().

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 SpecularPlotCanvas::onStatusString ( const QString &  name)
slot

Definition at line 63 of file SpecularPlotCanvas.cpp.

64 {
66 }
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:

◆ setItem()

void SpecularPlotCanvas::setItem ( SessionItem specularDataItem)
overridevirtual

Reimplemented from SessionItemWidget.

Definition at line 41 of file SpecularPlotCanvas.cpp.

42 {
45 }
virtual void setItem(SessionItem *item)
SpecularDataItem * specularDataItem(SessionItem *parent)
Returns SpecularDataItem contained as a child in givent parent.

References m_plot, SessionItemWidget::setItem(), and DataItemUtils::specularDataItem().

Referenced by SpecularDataCanvas::setItem().

Here is the call graph for this function:

◆ setStatusLabelEnabled()

void SpecularPlotCanvas::setStatusLabelEnabled ( bool  flag)

Definition at line 57 of file SpecularPlotCanvas.cpp.

58 {
60  m_statusLabel->setHidden(!flag);
61 }
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 SpecularDataCanvas::SpecularDataCanvas(), and SpecularPlotCanvas().

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:

◆ specularPlot()

SpecularPlot * SpecularPlotCanvas::specularPlot ( )

Definition at line 47 of file SpecularPlotCanvas.cpp.

48 {
49  return m_plot;
50 }

References m_plot.

◆ subscribeToItem()

◆ unsubscribeFromItem()

Member Data Documentation

◆ m_canvasEvent

FontScalingEvent* SpecularPlotCanvas::m_canvasEvent
private

Definition at line 46 of file SpecularPlotCanvas.h.

Referenced by SpecularPlotCanvas().

◆ m_itemController

◆ m_plot

SpecularPlot* SpecularPlotCanvas::m_plot
private

Definition at line 45 of file SpecularPlotCanvas.h.

Referenced by SpecularPlotCanvas(), customPlot(), setItem(), and specularPlot().

◆ m_statusLabel

PlotStatusLabel* SpecularPlotCanvas::m_statusLabel
private

Definition at line 47 of file SpecularPlotCanvas.h.

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


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