BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
statuslabel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/view/mvvm/widgets/statuslabel.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_STATUSLABEL_H
16 #define BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_STATUSLABEL_H
17 
18 #include "mvvm/view_export.h"
19 #include <QFrame>
20 
21 class QPaintEvent;
22 
23 namespace ModelView {
24 
25 //! Shows a single line of text on a white background.
26 //! Opposite to QLabel, doesn't trigger layout resize, being happy with place it has. If text string
27 //! is too long for current size, it will be clipped.
28 
29 class MVVM_VIEW_EXPORT StatusLabel : public QFrame {
30  Q_OBJECT
31 
32 public:
33  explicit StatusLabel(QWidget* parent = nullptr);
34 
35  void setText(const QString& text);
36  void setFont(const QFont& font);
37  void setPointSize(int pointSize);
38  void setAlignment(Qt::Alignment);
39 
40 protected:
41  void paintEvent(QPaintEvent* event);
42 
43 private:
44  QString m_text;
45  Qt::Alignment m_alignment;
46  QFont m_font;
47 };
48 
49 } // namespace ModelView
50 
51 #endif // BORNAGAIN_MVVM_VIEW_MVVM_WIDGETS_STATUSLABEL_H
Shows a single line of text on a white background.
Definition: statuslabel.h:29
Qt::Alignment m_alignment
Definition: statuslabel.h:45
materialitems.h Collection of materials to populate MaterialModel.