BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularPlotCanvas.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/PlotSpecular/SpecularPlotCanvas.cpp
6 //! @brief Declares class SpecularPlotCanvas
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
20 #include <QVBoxLayout>
21 
23  : SessionItemWidget(parent)
24  , m_plot(new SpecularPlot)
25  , m_canvasEvent(new FontScalingEvent(m_plot, this))
26  , m_statusLabel(new PlotStatusLabel(m_plot, this))
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 }
40 
42 {
45 }
46 
48 {
49  return m_plot;
50 }
51 
53 {
54  return m_plot->customPlot();
55 }
56 
58 {
60 }
61 
63 {
65  m_statusLabel->setHidden(!flag);
66 }
67 
69 {
71 }
Defines class FontScalingEvent.
Defines class PlotStatusLabel.
Defines class SpecularDataItem.
Defines class ColorMapCanvas.
Defines class SpecularPlot.
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....
void setLabelEnabled(bool flag)
Enables/disables label. If disabled, all colorMaps are disconnected and label is hiding.
The SessionItemWidget class is a base for all widgets representing the content of SessionItem....
virtual void setItem(SessionItem *item)
Base class for a GUI data item.
Definition: SessionItem.h:204
FontScalingEvent * m_canvasEvent
SpecularPlotCanvas(QWidget *parent=nullptr)
void setItem(SessionItem *specularDataItem) override
void onStatusString(const QString &name)
SpecularPlot * specularPlot()
PlotStatusLabel * m_statusLabel
QCustomPlot * customPlot()
void setStatusLabelEnabled(bool flag)
SpecularPlot * m_plot
The SpecularPlot class presents 1D intensity data from SpecularDataItem.
Definition: SpecularPlot.h:32
QCustomPlot * customPlot() override
Definition: SpecularPlot.h:44
void initScatter()
Adds scatter ro real data plot.
void setText(const QString &text)
Definition: StatusLabel.cpp:42
SpecularDataItem * specularDataItem(SessionItem *parent)
Returns SpecularDataItem contained as a child in givent parent.
QString const & name(EShape k)
Definition: particles.cpp:20