BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
Plot1DCanvas.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/PlotComparison/Plot1DCanvas.cpp
6 //! @brief Implements class Plot1DCanvas
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 
19 #include <QVBoxLayout>
20 
22  : SessionItemWidget(parent)
23  , m_plot(new Plot1D)
24  , m_canvasEvent(new FontScalingEvent(m_plot, this))
25  , m_statusLabel(new PlotStatusLabel(m_plot, this))
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 }
39 
41 {
42  SessionItemWidget::setItem(dataItemView);
43  m_plot->setItem(dataItemView);
44 }
45 
47 {
48  return m_plot;
49 }
50 
52 {
53  return m_plot->customPlot();
54 }
55 
57 {
59  m_statusLabel->setHidden(!flag);
60 }
61 
62 void Plot1DCanvas::onStatusString(const QString& name)
63 {
65 }
Defines class FontScalingEvent.
Defines class Plot1DCanvas.
Defines class Plot1D.
Defines class PlotStatusLabel.
Provides event filter for ScientificPlot. Its goal is to make font size adjustments on resize events.
QCustomPlot * customPlot()
void setStatusLabelEnabled(bool flag)
Plot1DCanvas(QWidget *parent=nullptr)
FontScalingEvent * m_canvasEvent
Definition: Plot1DCanvas.h:47
void onStatusString(const QString &name)
Plot1D * m_plot
Definition: Plot1DCanvas.h:46
PlotStatusLabel * m_statusLabel
Definition: Plot1DCanvas.h:48
Plot1D * plot1D()
void setItem(SessionItem *dataItemView) override
The Plot1D class presents data of several 1D DataItems contained in a Data1DViewItem....
Definition: Plot1D.h:32
QCustomPlot * customPlot() override
Definition: Plot1D.h:44
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
void setText(const QString &text)
Definition: StatusLabel.cpp:42
QString const & name(EShape k)
Definition: particles.cpp:20