ifw-fcf 7.1.4
Loading...
Searching...
No Matches
qeansivalveremote.hpp
Go to the documentation of this file.
1#ifndef QEANSIVALVEREMOTE_H
2#define QEANSIVALVEREMOTE_H
3
4#include <QObject>
5#include <QWidget>
6#include <QTimer>
7
8
9class QeAnsiValveRemote : 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 Q_PROPERTY(bool open MEMBER m_open READ isOpen WRITE setOpen NOTIFY openChanged)
17
18
19public:
20 QeAnsiValveRemote(QWidget *parent = 0);
21 bool isOpen(){ return m_open; };
22
23public slots:
24 void setOpen(bool new_state);
25 void set_vertical( bool arg ){ m_vertical = arg; update(); }
26 void set_other_side( bool arg ){ m_other_side = arg; update(); }
27 void set_flashing( bool arg ){ m_flashing = arg; arg ? timer->start(1000): timer->stop(); update(); }
28 void set_flash_color( const QColor &arg ){ m_flash_color = arg; update(); }
29
30signals:
31 void openChanged(bool open);
32
33
34private:
35 void paintEvent(QPaintEvent *event);
36 bool m_vertical = false;
37 bool m_other_side = false;
38 bool m_flashing = false;
39 bool m_open = false;
40 QColor m_flash_color;
41 QTimer *timer;
42 void resizeEvent(QResizeEvent *event);
43 void paint_handle(QPainter &painter, QPen &pen, QBrush &lineBrush, QBrush &fillBrush);
44 void paint_body(QPainter &painter, QPen &pen, QBrush &lineBrush, QBrush &fillBrush);
45 void paint_text(QPainter &painter, QPen &pen, QBrush &lineBrush, QBrush &fillBrush);
46 QColor m_bg_color;
47
48};
49
50#endif // QEANSIVALVEREMOTE_H
Definition qeansivalveremote.hpp:10
void set_other_side(bool arg)
Definition qeansivalveremote.hpp:26
bool flashing
Definition qeansivalveremote.hpp:14
bool other_side
Definition qeansivalveremote.hpp:13
void set_vertical(bool arg)
Definition qeansivalveremote.hpp:25
void set_flash_color(const QColor &arg)
Definition qeansivalveremote.hpp:28
void set_flashing(bool arg)
Definition qeansivalveremote.hpp:27
void setOpen(bool new_state)
Definition qeansivalveremote.cpp:92
void openChanged(bool open)
bool isOpen()
Definition qeansivalveremote.hpp:21
bool vertical
Definition qeansivalveremote.hpp:12
bool open
Definition qeansivalveremote.hpp:16
QColor flash_color
Definition qeansivalveremote.hpp:15