BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
CautionSign.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Info/CautionSign.h
6 //! @brief Defines class CautionSign
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_CAUTIONSIGN_H
16 #define BORNAGAIN_GUI_VIEW_INFO_CAUTIONSIGN_H
17 
18 #include <QObject>
19 
20 class CautionSignWidget;
21 class QWidget;
22 
23 //! The CautionSign controls appearance of CautionSignWidget on top of parent widget.
24 
25 class CautionSign : public QObject {
26 public:
27  CautionSign(QWidget* parent);
28 
29  void clear();
30 
31  void setCautionHeader(const QString& cautionHeader);
32 
33  void setCautionMessage(const QString& cautionMessage);
34 
35  void setArea(QWidget* area);
36 
37  bool isShown() const;
38 
39 protected:
40  bool eventFilter(QObject* obj, QEvent* event) override;
41 
42 private:
43  void updateLabelGeometry();
44  QPoint positionForCautionSign() const;
45 
49  QWidget* m_area;
51 };
52 
53 #endif // BORNAGAIN_GUI_VIEW_INFO_CAUTIONSIGN_H
The CautionSignWidget is an transparent widget with caution sign pixmap intended to be overlayed onto...
The CautionSign controls appearance of CautionSignWidget on top of parent widget.
Definition: CautionSign.h:25
bool eventFilter(QObject *obj, QEvent *event) override
Definition: CautionSign.cpp:90
void updateLabelGeometry()
Definition: CautionSign.cpp:98
QWidget * m_area
Definition: CautionSign.h:49
CautionSign(QWidget *parent)
Definition: CautionSign.cpp:30
bool isShown() const
Definition: CautionSign.cpp:85
void setCautionHeader(const QString &cautionHeader)
Definition: CautionSign.cpp:52
QString m_caution_message
Definition: CautionSign.h:47
CautionSignWidget * m_cautionWidget
Definition: CautionSign.h:48
void setArea(QWidget *area)
Definition: CautionSign.cpp:79
void clear()
Clears caution message;.
Definition: CautionSign.cpp:42
QPoint positionForCautionSign() const
QString m_caution_header
Definition: CautionSign.h:46
bool m_clear_just_had_happened
Definition: CautionSign.h:50
void setCautionMessage(const QString &cautionMessage)
Shows caution sign on the screen. If clear of previous caution sign had happened just few msec ago,...
Definition: CautionSign.cpp:60