BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
OverlayLabelWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Info/OverlayLabelWidget.h
6 //! @brief Defines class OverlayLabelWidget
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_INFO_OVERLAYLABELWIDGET_H
16 #define BORNAGAIN_GUI_VIEW_INFO_OVERLAYLABELWIDGET_H
17 
18 #include <QRect>
19 #include <QString>
20 #include <QWidget>
21 
22 //! The OverlayLabelWidget is a semi-transparent overlay label to place on top of other
23 //! widgets outside of any layout context.
24 
25 class OverlayLabelWidget : public QWidget {
26  Q_OBJECT
27 public:
28  OverlayLabelWidget(QWidget* parent = nullptr);
29 
30  void setRectangle(const QRect& rect);
31  void setPosition(int x, int y);
32 
33  void setText(const QString& text) { m_text = text; }
34 
35 protected:
36  void paintEvent(QPaintEvent* event) override;
37 
38 private:
39  QString m_text;
41 };
42 
43 #endif // BORNAGAIN_GUI_VIEW_INFO_OVERLAYLABELWIDGET_H
The OverlayLabelWidget is a semi-transparent overlay label to place on top of other widgets outside o...
OverlayLabelWidget(QWidget *parent=nullptr)
void setRectangle(const QRect &rect)
void paintEvent(QPaintEvent *event) override
void setText(const QString &text)
void setPosition(int x, int y)