BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
WarningSign.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/InfoWidgets/WarningSign.h
6 //! @brief Defines class WarningSign
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_COREGUI_VIEWS_INFOWIDGETS_WARNINGSIGN_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_INFOWIDGETS_WARNINGSIGN_H
17 
18 #include <QObject>
19 
20 class WarningSignWidget;
21 class QWidget;
22 
23 //! The WarningSign controls appearance of WarningSignWidget on top of parent widget.
24 
25 class WarningSign : public QObject {
26 public:
27  WarningSign(QWidget* parent);
28 
29  void clear();
30 
31  void setWarningHeader(const QString& warningHeader);
32 
33  void setWarningMessage(const QString& warningMessage);
34 
35  void setArea(QWidget* area);
36 
37  bool isShown() const;
38 
39 protected:
40  bool eventFilter(QObject* obj, QEvent* event);
41 
42 private:
43  void updateLabelGeometry();
44  QPoint positionForWarningSign() const;
45 
49  QWidget* m_area;
51 };
52 
53 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_INFOWIDGETS_WARNINGSIGN_H
The WarningSignWidget is an transparent widget with warning sign pixmap intended to be overlayed onto...
The WarningSign controls appearance of WarningSignWidget on top of parent widget.
Definition: WarningSign.h:25
QString m_warning_message
Definition: WarningSign.h:47
QWidget * m_area
Definition: WarningSign.h:49
WarningSign(QWidget *parent)
Definition: WarningSign.cpp:28
WarningSignWidget * m_warningWidget
Definition: WarningSign.h:48
void setWarningHeader(const QString &warningHeader)
Definition: WarningSign.cpp:50
QPoint positionForWarningSign() const
void setArea(QWidget *area)
Definition: WarningSign.cpp:78
void clear()
Clears warning message;.
Definition: WarningSign.cpp:40
bool eventFilter(QObject *obj, QEvent *event)
Definition: WarningSign.cpp:89
void setWarningMessage(const QString &warningMessage)
Shows warning sign on the screen.
Definition: WarningSign.cpp:58
void updateLabelGeometry()
Definition: WarningSign.cpp:97
bool m_clear_just_had_happened
Definition: WarningSign.h:50
QString m_warning_header
Definition: WarningSign.h:46
bool isShown() const
Definition: WarningSign.cpp:84