BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The PlotStatusLabel class shows status string as reported by DescriptedPlot in a frame. More...
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) |
Private Slots | |
void | onPlotDestroyed (QObject *obj) |
Private Member Functions | |
void | setConnected (ScientificPlot *plot, bool flag) |
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 |
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.
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 24 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 79 of file PlotStatusLabel.cpp.
References m_plots.
Referenced by setConnected().
|
slot |
Definition at line 53 of file PlotStatusLabel.cpp.
References StatusLabel::setText().
Referenced by setConnected().
|
protectedinherited |
Definition at line 63 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 45 of file PlotStatusLabel.cpp.
References m_plots, and setPlotLabelEnabled().
Referenced by MaskEditorCanvas::resetContext(), ProjectionsEditorCanvas::setColorMap(), FitComparisonWidget::subscribeToItem(), and FitComparisonWidget1D::subscribeToItem().
|
inherited |
Definition at line 57 of file StatusLabel.cpp.
References StatusLabel::m_alignment.
|
private |
Connects with colorMap's status string signal.
Definition at line 68 of file PlotStatusLabel.cpp.
References onPlotDestroyed(), onPlotStatusString(), and ScientificPlot::statusString().
Referenced by setPlotLabelEnabled().
|
inherited |
Definition at line 45 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 35 of file PlotStatusLabel.cpp.
References m_plots, and setPlotLabelEnabled().
Referenced by ColorMapCanvas::setStatusLabelEnabled(), Plot1DCanvas::setStatusLabelEnabled(), and SpecularPlotCanvas::setStatusLabelEnabled().
|
private |
Enables/disables showing of label for given plot.
Definition at line 60 of file PlotStatusLabel.cpp.
References setConnected(), and ScientificPlot::setMouseTrackingEnabled().
Referenced by addPlot(), reset(), and setLabelEnabled().
|
inherited |
Definition at line 51 of file StatusLabel.cpp.
References StatusLabel::m_font.
|
inherited |
Definition at line 39 of file StatusLabel.cpp.
References StatusLabel::m_text.
Referenced by onPlotStatusString(), ColorMapCanvas::onStatusString(), Plot1DCanvas::onStatusString(), and SpecularPlotCanvas::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().