master
parent
617764b181
commit
7e8e1b2eb6
|
@ -28,6 +28,7 @@ LightButton::LightButton(QWidget *parent) : QWidget(parent)
|
||||||
canMove = false;
|
canMove = false;
|
||||||
this->installEventFilter(this);
|
this->installEventFilter(this);
|
||||||
|
|
||||||
|
isAlarm = false;
|
||||||
timerAlarm = new QTimer(this);
|
timerAlarm = new QTimer(this);
|
||||||
connect(timerAlarm, SIGNAL(timeout()), this, SLOT(alarm()));
|
connect(timerAlarm, SIGNAL(timeout()), this, SLOT(alarm()));
|
||||||
timerAlarm->setInterval(500);
|
timerAlarm->setInterval(500);
|
||||||
|
@ -435,7 +436,6 @@ void LightButton::stopAlarm()
|
||||||
|
|
||||||
void LightButton::alarm()
|
void LightButton::alarm()
|
||||||
{
|
{
|
||||||
static bool isAlarm = false;
|
|
||||||
if (isAlarm) {
|
if (isAlarm) {
|
||||||
textColor = QColor(255, 255, 255);
|
textColor = QColor(255, 255, 255);
|
||||||
bgColor = normalColor;
|
bgColor = normalColor;
|
||||||
|
|
|
@ -76,6 +76,7 @@ private:
|
||||||
bool showOverlay; //是否显示遮罩层
|
bool showOverlay; //是否显示遮罩层
|
||||||
QColor overlayColor; //遮罩层颜色
|
QColor overlayColor; //遮罩层颜色
|
||||||
|
|
||||||
|
bool isAlarm; //是否报警
|
||||||
QTimer *timerAlarm; //定时器切换颜色
|
QTimer *timerAlarm; //定时器切换颜色
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue