BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
PlotStatusLabel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/PlotUtil/PlotStatusLabel.h
6 //! @brief Defines class PlotStatusLabel
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 
15 #ifndef BORNAGAIN_GUI_VIEW_PLOTUTIL_PLOTSTATUSLABEL_H
16 #define BORNAGAIN_GUI_VIEW_PLOTUTIL_PLOTSTATUSLABEL_H
17 
19 #include <QList>
20 
21 class ScientificPlot;
22 class QResizeEvent;
23 
24 //! The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame.
25 //! Can work with more than one DescriptedPlot. Provides automatic adjustment of font size,
26 //! depending on available space in parent layout. Also doesn't trigger layout resize,
27 //! being happy with place it has.
28 
29 class PlotStatusLabel : public StatusLabel {
30  Q_OBJECT
31 public:
32  PlotStatusLabel(ScientificPlot* plot, QWidget* parent = nullptr);
33 
34  void addPlot(ScientificPlot* plot);
35 
36  void setLabelEnabled(bool flag);
37 
38  void reset();
39 
40 public slots:
41  void onPlotStatusString(const QString& text);
42 
43 private slots:
44  void onPlotDestroyed(QObject* obj);
45 
46 private:
47  void setPlotLabelEnabled(ScientificPlot* plot, bool flag);
48  void setConnected(ScientificPlot* plot, bool flag) const;
49 
50  QList<ScientificPlot*> m_plots;
51 };
52 
53 #endif // BORNAGAIN_GUI_VIEW_PLOTUTIL_PLOTSTATUSLABEL_H
Defines class StatusLabel.
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame....
void onPlotDestroyed(QObject *obj)
void setConnected(ScientificPlot *plot, bool flag) const
Connects with colorMap's status string signal.
void reset()
Disconnects all color maps from the label.
QList< ScientificPlot * > m_plots
void addPlot(ScientificPlot *plot)
void setPlotLabelEnabled(ScientificPlot *plot, bool flag)
Enables/disables showing of label for given plot.
void setLabelEnabled(bool flag)
Enables/disables label. If disabled, all colorMaps are disconnected and label is hiding.
void onPlotStatusString(const QString &text)
PlotStatusLabel(ScientificPlot *plot, QWidget *parent=nullptr)
Common interface for plot-descriptor interaction.
The StatusLabel class shows a single line of text on a white background. Opposite to QLabel,...
Definition: StatusLabel.h:28