ifw-fcfui 1.0.1
 
Loading...
Searching...
No Matches
qeheater.hpp
Go to the documentation of this file.
1
5
6#ifndef QEHEATER_H
7#define QEHEATER_H
8
9#include <QObject>
10#include <QWidget>
11#include <QLabel>
12#include <QTimer>
13
14class QeHeater : public QLabel
15{
16 Q_OBJECT
17 Q_PROPERTY(bool vertical MEMBER m_vertical WRITE set_vertical)
18 Q_PROPERTY(bool other_side MEMBER m_other_side WRITE set_other_side)
19 Q_PROPERTY(bool flashing MEMBER m_flashing WRITE set_flashing)
20 Q_PROPERTY(QColor flash_color MEMBER m_flash_color WRITE set_flash_color)
21 Q_PROPERTY(int font_size MEMBER m_font_size WRITE set_font_size)
22
23public:
24 explicit QeHeater(QWidget *parent = nullptr);
25
26signals:
27
28public slots:
29 void set_vertical( bool arg ){ m_vertical = arg; update(); }
30 void set_other_side( bool arg ){ m_other_side = arg; update(); }
31 void set_flashing( bool arg ){ m_flashing = arg; arg ? timer->start(1000): timer->stop(); update(); }
32 void set_flash_color( const QColor &arg ){ m_flash_color = arg; update(); }
33 void set_font_size( const int &arg ){ m_font_size = arg; update(); }
34
35protected:
36 QSize sizeHint() const ;
37 QSize minimumSizeHint() const;
38 void paintEvent(QPaintEvent *event);
39 bool m_vertical = false;
40 bool m_other_side = false;
41 bool m_flashing = false;
42 int m_font_size = 0;
44 QTimer *timer;
45
46};
47
48#endif // QEHEATER_H
void paintEvent(QPaintEvent *event)
Definition qeheater.cpp:32
int m_font_size
Definition qeheater.hpp:42
QColor m_flash_color
Definition qeheater.hpp:43
bool m_other_side
Definition qeheater.hpp:40
void set_flashing(bool arg)
Definition qeheater.hpp:31
void set_vertical(bool arg)
Definition qeheater.hpp:29
bool other_side
Definition qeheater.hpp:18
void set_other_side(bool arg)
Definition qeheater.hpp:30
QeHeater(QWidget *parent=nullptr)
Definition qeheater.cpp:18
QSize sizeHint() const
Definition qeheater.cpp:82
QTimer * timer
Definition qeheater.hpp:44
bool flashing
Definition qeheater.hpp:19
bool m_flashing
Definition qeheater.hpp:41
QColor flash_color
Definition qeheater.hpp:20
bool m_vertical
Definition qeheater.hpp:39
void set_flash_color(const QColor &arg)
Definition qeheater.hpp:32
QSize minimumSizeHint() const
Definition qeheater.cpp:69
bool vertical
Definition qeheater.hpp:17
void set_font_size(const int &arg)
Definition qeheater.hpp:33
int font_size
Definition qeheater.hpp:21