ifw-fcf  5.0.0-pre2
qeansivalvemanual.hpp
Go to the documentation of this file.
1 #ifndef QEANSIVALVEMANUAL_H
2 #define QEANSIVALVEMANUAL_H
3 
4 #include <QObject>
5 #include <QWidget>
6 #include <QTimer>
7 
8 
9 class QeAnsiValveManual : public QWidget
10 {
11  Q_OBJECT
12  Q_PROPERTY(bool vertical MEMBER m_vertical WRITE set_vertical)
13  Q_PROPERTY(bool other_side MEMBER m_other_side WRITE set_other_side)
14  Q_PROPERTY(bool flashing MEMBER m_flashing WRITE set_flashing)
15  Q_PROPERTY(QColor flash_color MEMBER m_flash_color WRITE set_flash_color)
16 
17 
18 public:
19  QeAnsiValveManual(QWidget *parent = 0);
20 
21 public slots:
22  void set_vertical( bool arg ){ m_vertical = arg; update(); }
23  void set_other_side( bool arg ){ m_other_side = arg; update(); }
24  void set_flashing( bool arg ){ m_flashing = arg; arg ? timer->start(1000): timer->stop(); update(); }
25  void set_flash_color( const QColor &arg ){ m_flash_color = arg; update(); }
26 
27 
28 private:
29  void paintEvent(QPaintEvent *event);
30  bool m_vertical = false;
31  bool m_other_side = false;
32  bool m_flashing = false;
33  QColor m_flash_color;
34  QTimer *timer;
35  void resizeEvent(QResizeEvent *event);
36  void paint_body(QPainter &painter, QPen &pen, QBrush &lineBrush, QBrush &fillBrush);
37  void paint_handle(QPainter &painter, QPen &pen, QBrush &lineBrush, QBrush &fillBrush);
38  QColor m_bg_color;
39 
40 };
41 
42 #endif // QEANSIVALVEMANUAL_H
Definition: qeansivalvemanual.hpp:10
void set_vertical(bool arg)
Definition: qeansivalvemanual.hpp:22
bool other_side
Definition: qeansivalvemanual.hpp:13
bool vertical
Definition: qeansivalvemanual.hpp:12
void set_flashing(bool arg)
Definition: qeansivalvemanual.hpp:24
void set_flash_color(const QColor &arg)
Definition: qeansivalvemanual.hpp:25
void set_other_side(bool arg)
Definition: qeansivalvemanual.hpp:23
QeAnsiValveManual(QWidget *parent=0)
Definition: qeansivalvemanual.cpp:12
QColor flash_color
Definition: qeansivalvemanual.hpp:15
bool flashing
Definition: qeansivalvemanual.hpp:14