BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
CautionSignWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Info/CautionSignWidget.h
6 //! @brief Defines class CautionSignWidget
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_CAUTIONSIGNWIDGET_H
16 #define BORNAGAIN_GUI_VIEW_INFO_CAUTIONSIGNWIDGET_H
17 
18 #include <QPixmap>
19 #include <QString>
20 #include <QWidget>
21 
22 //! The CautionSignWidget is an transparent widget with caution sign pixmap intended to be
23 //! overlayed onto other widget at some arbitrary position.
24 class CautionSignWidget : public QWidget {
25 public:
26  CautionSignWidget(QWidget* parent = nullptr);
27 
28  void setPosition(int x, int y);
29 
30  void setCautionHeader(const QString& message);
31  void setCautionMessage(const QString& message) { m_caution_message = message; }
32 
33 protected:
34  void paintEvent(QPaintEvent* event) override;
35  void mousePressEvent(QMouseEvent* event) override;
36 
37 private:
38  QPixmap m_pixmap;
41 };
42 
43 #endif // BORNAGAIN_GUI_VIEW_INFO_CAUTIONSIGNWIDGET_H
The CautionSignWidget is an transparent widget with caution sign pixmap intended to be overlayed onto...
CautionSignWidget(QWidget *parent=nullptr)
void setCautionHeader(const QString &message)
void paintEvent(QPaintEvent *event) override
void setCautionMessage(const QString &message)
void mousePressEvent(QMouseEvent *event) override
void setPosition(int x, int y)
set geometry of widget around center point