CableTestBench/Sources/Widgets/ONOFFStatusWidget.h
2019-05-08 14:17:31 -04:00

51 lines
817 B
C++

#ifndef ONOFFSTATUSWIDGET_H
#define ONOFFSTATUSWIDGET_H
#include <QWidget>
#include <QRect>
#include <QTimer>
#include <QLabel>
class CONOFFStatusWidget : public QWidget
{
Q_OBJECT
public:
enum eONOFFLedColor
{
ON_OFF_LED_COLOR_GREEN,
ON_OFF_LED_COLOR_RED
};
CONOFFStatusWidget(eONOFFLedColor Color,int index = -1, QWidget *Parent = NULL,QString Label = QString());
~CONOFFStatusWidget();
void paintEvent(QPaintEvent *PaintEvent);
void resizeEvent(QResizeEvent *);
void mouseReleaseEvent(QMouseEvent *event);
QLabel *mLabel;
QPixmap mLedOnPixmap,mLedOffPixmap;
bool mIsOn;
void SetON();
void SetOFF();
void Toggle();
void SetState(bool IsON);
int mIndex;
signals:
void Clicked(int index);
};
#endif // ONOFFSTATUSWIDGET_H