BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
OverlayLabelController.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Info/OverlayLabelController.h
6 //! @brief Defines class OverlayLabelController
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_OVERLAYLABELCONTROLLER_H
16 #define BORNAGAIN_GUI_VIEW_INFO_OVERLAYLABELCONTROLLER_H
17 
18 #include <QObject>
19 #include <QString>
20 
21 class OverlayLabelWidget;
22 class QAbstractScrollArea;
23 
24 //! The OverlayLabelController class controlls appearance of InfoLabelWidget (position, show/hide)
25 //! on top of some scroll area.
26 
27 class OverlayLabelController : public QObject {
28  Q_OBJECT
29 public:
30  OverlayLabelController(QObject* parent = nullptr);
31 
32  void setText(const QString& text);
33 
34  void setArea(QAbstractScrollArea* area);
35 
36  void setShown(bool shown);
37 
38 protected:
39  bool eventFilter(QObject* obj, QEvent* event) override;
40 
41 private:
42  void updateLabelGeometry();
43 
45  QAbstractScrollArea* m_area;
46  QString m_text;
47 };
48 
49 #endif // BORNAGAIN_GUI_VIEW_INFO_OVERLAYLABELCONTROLLER_H
The OverlayLabelController class controlls appearance of InfoLabelWidget (position,...
QAbstractScrollArea * m_area
void setArea(QAbstractScrollArea *area)
bool eventFilter(QObject *obj, QEvent *event) override
void setText(const QString &text)
void setShown(bool shown)
Shows/removes a label from the controlled widget.
OverlayLabelController(QObject *parent=nullptr)
OverlayLabelWidget * m_label
The OverlayLabelWidget is a semi-transparent overlay label to place on top of other widgets outside o...