BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FancyLabel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/utils/FancyLabel.h
6 //! @brief Defines class FancyLabel
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_UTILS_FANCYLABEL_H
16 #define BORNAGAIN_GUI_COREGUI_UTILS_FANCYLABEL_H
17 
18 #include <QLabel>
19 
20 //! The FancyLabel class is a QLabel-like class with trivial animation when text slowly
21 //! appears on the screen from left to right, pretending to be typed.
22 
23 class FancyLabel : public QLabel {
24  Q_OBJECT
25 
26 public:
27  FancyLabel(const QString& text, QWidget* parent = nullptr);
28  FancyLabel(QWidget* parent = nullptr);
29 
30  void setTextAnimated(const QString& animated_text);
31 
32 private slots:
33  void onTimeout();
34 
35 private:
36  void init_fancy_label();
37 
38  QString m_text;
39  QTimer* m_timer{nullptr};
42 };
43 
44 #endif // BORNAGAIN_GUI_COREGUI_UTILS_FANCYLABEL_H
The FancyLabel class is a QLabel-like class with trivial animation when text slowly appears on the sc...
Definition: FancyLabel.h:23
int m_current_index
Definition: FancyLabel.h:41
void init_fancy_label()
Definition: FancyLabel.cpp:59
void onTimeout()
Definition: FancyLabel.cpp:49
QTimer * m_timer
Definition: FancyLabel.h:39
FancyLabel(const QString &text, QWidget *parent=nullptr)
Definition: FancyLabel.cpp:18
void setTextAnimated(const QString &animated_text)
Definition: FancyLabel.cpp:28
int m_total_effect_duration
Definition: FancyLabel.h:40
QString m_text
Definition: FancyLabel.h:38