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

Description

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

Definition at line 28 of file SpecularPlotCanvas.h.

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 initScatter ()
 
void setItem (SessionItem *specularDataItem) override
 
void setStatusLabelEnabled (bool flag)
 
SpecularPlotspecularPlot ()
 

Protected Member Functions

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

Private Attributes

FontScalingEventm_canvasEvent
 
SessionItemControllerm_itemController
 
SpecularPlotm_plot
 
PlotStatusLabelm_statusLabel
 

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  auto* 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. Its goal is to make font size adjustments on resize events.
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame....
SessionItemWidget(QWidget *parent=nullptr)
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]

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

◆ initScatter()

void SpecularPlotCanvas::initScatter ( )

Definition at line 57 of file SpecularPlotCanvas.cpp.

58 {
60 }
void initScatter()
Adds scatter ro real data plot.

References SpecularPlot::initScatter(), and m_plot.

Referenced by SpecularDataCanvas::initScatter().

Here is the call graph for this function:

◆ onStatusString

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

Definition at line 68 of file SpecularPlotCanvas.cpp.

69 {
71 }
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:

◆ 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 GUI::Model::DataItemUtils::specularDataItem().

Referenced by SpecularDataCanvas::setItem().

Here is the call graph for this function:

◆ setStatusLabelEnabled()

void SpecularPlotCanvas::setStatusLabelEnabled ( bool  flag)

Definition at line 62 of file SpecularPlotCanvas.cpp.

63 {
65  m_statusLabel->setHidden(!flag);
66 }
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 *  )
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:

◆ specularPlot()

SpecularPlot * SpecularPlotCanvas::specularPlot ( )

Definition at line 47 of file SpecularPlotCanvas.cpp.

48 {
49  return m_plot;
50 }

References m_plot.

◆ subscribeToItem()

◆ unsubscribeFromItem()

virtual void SessionItemWidget::unsubscribeFromItem ( )
inlineprotectedvirtualinherited

Member Data Documentation

◆ m_canvasEvent

FontScalingEvent* SpecularPlotCanvas::m_canvasEvent
private

Definition at line 47 of file SpecularPlotCanvas.h.

Referenced by SpecularPlotCanvas().

◆ m_itemController

◆ m_plot

SpecularPlot* SpecularPlotCanvas::m_plot
private

◆ m_statusLabel

PlotStatusLabel* SpecularPlotCanvas::m_statusLabel
private

Definition at line 48 of file SpecularPlotCanvas.h.

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


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