BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame. Can work with more than one DescriptedPlot. Provides automatic adjustment of font size, depending on available space in parent layout. Also doesn't trigger layout resize, being happy with place it has.
Definition at line 29 of file PlotStatusLabel.h.
Public Slots | |
void | onPlotStatusString (const QString &text) |
Public Member Functions | |
PlotStatusLabel (ScientificPlot *plot, QWidget *parent=nullptr) | |
void | addPlot (ScientificPlot *plot) |
void | reset () |
Disconnects all color maps from the label. More... | |
void | setAlignment (Qt::Alignment) |
void | setFont (const QFont &font) |
void | setLabelEnabled (bool flag) |
Enables/disables label. If disabled, all colorMaps are disconnected and label is hiding. More... | |
void | setPointSize (int pointSize) |
void | setText (const QString &text) |
Protected Member Functions | |
void | paintEvent (QPaintEvent *event) override |
Private Slots | |
void | onPlotDestroyed (QObject *obj) |
Private Member Functions | |
void | setConnected (ScientificPlot *plot, bool flag) const |
Connects with colorMap's status string signal. More... | |
void | setPlotLabelEnabled (ScientificPlot *plot, bool flag) |
Enables/disables showing of label for given plot. More... | |
Private Attributes | |
Qt::Alignment | m_alignment |
QFont | m_font |
QList< ScientificPlot * > | m_plots |
QString | m_text |
PlotStatusLabel::PlotStatusLabel | ( | ScientificPlot * | plot, |
QWidget * | parent = nullptr |
||
) |
Definition at line 18 of file PlotStatusLabel.cpp.
References addPlot().
void PlotStatusLabel::addPlot | ( | ScientificPlot * | plot | ) |
Definition at line 25 of file PlotStatusLabel.cpp.
References m_plots, and setPlotLabelEnabled().
Referenced by PlotStatusLabel(), ProjectionsEditorCanvas::setColorMap(), MaskEditorCanvas::setMaskContext(), FitComparisonWidget::subscribeToItem(), and FitComparisonWidget1D::subscribeToItem().
|
privateslot |
Definition at line 80 of file PlotStatusLabel.cpp.
References m_plots.
Referenced by setConnected().
|
slot |
Definition at line 54 of file PlotStatusLabel.cpp.
References StatusLabel::setText().
Referenced by setConnected().
|
overrideprotectedinherited |
Definition at line 66 of file StatusLabel.cpp.
References StatusLabel::m_alignment, StatusLabel::m_font, and StatusLabel::m_text.
void PlotStatusLabel::reset | ( | ) |
Disconnects all color maps from the label.
Definition at line 46 of file PlotStatusLabel.cpp.
References m_plots, and setPlotLabelEnabled().
Referenced by MaskEditorCanvas::resetContext(), ProjectionsEditorCanvas::setColorMap(), FitComparisonWidget::subscribeToItem(), and FitComparisonWidget1D::subscribeToItem().
|
inherited |
Definition at line 60 of file StatusLabel.cpp.
References StatusLabel::m_alignment.
|
private |
Connects with colorMap's status string signal.
Definition at line 69 of file PlotStatusLabel.cpp.
References onPlotDestroyed(), onPlotStatusString(), and ScientificPlot::statusString().
Referenced by setPlotLabelEnabled().
|
inherited |
Definition at line 48 of file StatusLabel.cpp.
References StatusLabel::m_font.
void PlotStatusLabel::setLabelEnabled | ( | bool | flag | ) |
Enables/disables label. If disabled, all colorMaps are disconnected and label is hiding.
Definition at line 36 of file PlotStatusLabel.cpp.
References m_plots, and setPlotLabelEnabled().
Referenced by Plot1DCanvas::setStatusLabelEnabled(), SpecularPlotCanvas::setStatusLabelEnabled(), and ColorMapCanvas::setStatusLabelEnabled().
|
private |
Enables/disables showing of label for given plot.
Definition at line 61 of file PlotStatusLabel.cpp.
References setConnected(), and ScientificPlot::setMouseTrackingEnabled().
Referenced by addPlot(), reset(), and setLabelEnabled().
|
inherited |
Definition at line 54 of file StatusLabel.cpp.
References StatusLabel::m_font.
|
inherited |
Definition at line 42 of file StatusLabel.cpp.
References StatusLabel::m_text.
Referenced by onPlotStatusString(), Plot1DCanvas::onStatusString(), SpecularPlotCanvas::onStatusString(), and ColorMapCanvas::onStatusString().
|
privateinherited |
Definition at line 44 of file StatusLabel.h.
Referenced by StatusLabel::paintEvent(), and StatusLabel::setAlignment().
|
privateinherited |
Definition at line 45 of file StatusLabel.h.
Referenced by StatusLabel::paintEvent(), StatusLabel::setFont(), and StatusLabel::setPointSize().
|
private |
Definition at line 50 of file PlotStatusLabel.h.
Referenced by addPlot(), onPlotDestroyed(), reset(), and setLabelEnabled().
|
privateinherited |
Definition at line 43 of file StatusLabel.h.
Referenced by StatusLabel::paintEvent(), and StatusLabel::setText().