6#include <QtSvg/QSvgRenderer>
8#include <QXmlStreamReader>
30class QeLed :
public QWidget
56 Q_PROPERTY(
bool lit READ isLit WRITE setLit NOTIFY
toggled)
65 explicit QeLed(QWidget *parent =
nullptr);
66 QColor
colorOn(){
return this->m_colorOn;}
67 QColor
colorOff(){
return this->m_colorOff;}
68 bool isLit(){
return this->m_lit;}
69 bool isNegated(){
return this->m_negate;}
72 void setColorOn(QColor newColorOn){
73 this->m_colorOn = newColorOn;
77 void setColorOff(QColor newColorOff){
78 this->m_colorOff = newColorOff;
82 void setLit(
bool newValue){
83 this->m_lit = newValue;
87 void setNegate(
bool newValue){
88 this->m_negate = newValue;
115 void paintEvent(QPaintEvent *event)
override;
116 void resizeEvent(QResizeEvent *event)
override;
120 bool m_negate =
false;
124 QSvgRenderer m_svg_on;
125 QSvgRenderer m_svg_off;
126 QString m_originalXml;
127 QString m_modifiedXml;
128 const QString c_ledImagePath =
":/led.svg";
131 QColor calculateColor();
void negated(bool newValue)
If the negate value changes, the signal send.
void toggled(bool newValue)
If the lit value changes, the signal send.
QColor colorOn
Color to be used when the LED is lit, or turned on.
Definition QeLed.hpp:41
QColor colorOff
Color to be used when the LED is turned off.
Definition QeLed.hpp:50
bool lit
Indicates if the led is to be on or not.
Definition QeLed.hpp:56
void colorOffChanged(QColor newColorOff)
Communicates a change in off color.
bool negate
Configures the widget to negate the lit value.
Definition QeLed.hpp:62
void colorOnChanged(QColor newColorOn)
Communicates a change in on color.