BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ColorMapCanvas.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/PlotUtil/ColorMapCanvas.cpp
6 //! @brief Declares class ColorMapCanvas
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 <QLabel>
21 #include <QVBoxLayout>
22 
24  : SessionItemWidget(parent)
25  , m_colorMap(new ColorMap)
26  , m_canvasEvent(new FontScalingEvent(m_colorMap, this))
27  , m_statusLabel(new PlotStatusLabel(m_colorMap, this))
28 {
29  this->installEventFilter(m_canvasEvent);
30  auto* layout = new QVBoxLayout;
31  layout->setMargin(0);
32  layout->setSpacing(0);
33 
34  layout->addWidget(m_colorMap);
35  layout->addWidget(m_statusLabel);
36 
37  setLayout(layout);
38 
39  setStatusLabelEnabled(false);
40 }
41 
43 {
46 }
47 
49 {
50  return m_colorMap;
51 }
52 
54 {
55  return m_colorMap->customPlot();
56 }
57 
59 {
61  m_statusLabel->setHidden(!flag);
62 }
63 
65 {
67 }
Defines class ColorMapCanvas.
Defines class ColorMap.
Defines class FontScalingEvent.
Defines class IntensityDataItem.
Defines class PlotStatusLabel.
ColorMapCanvas(QWidget *parent=nullptr)
void onStatusString(const QString &name)
ColorMap * m_colorMap
PlotStatusLabel * m_statusLabel
void setItem(SessionItem *intensityDataItem) override
ColorMap * colorMap()
void setStatusLabelEnabled(bool flag)
QCustomPlot * customPlot()
FontScalingEvent * m_canvasEvent
The ColorMap class presents 2D intensity data from IntensityDataItem as color map.
Definition: ColorMap.h:36
QCustomPlot * customPlot() override
Definition: ColorMap.h:45
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
void setText(const QString &text)
Definition: StatusLabel.cpp:42
IntensityDataItem * intensityDataItem(SessionItem *parent)
Returns IntensityDataItem contained as a child in givent parent.
QString const & name(EShape k)
Definition: particles.cpp:20