master
feiyangqingyun 2019-11-26 15:26:25 +08:00
parent 617764b181
commit 7e8e1b2eb6
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -76,6 +76,7 @@ private:
bool showOverlay; //是否显示遮罩层 bool showOverlay; //是否显示遮罩层
QColor overlayColor; //遮罩层颜色 QColor overlayColor; //遮罩层颜色
bool isAlarm; //是否报警
QTimer *timerAlarm; //定时器切换颜色 QTimer *timerAlarm; //定时器切换颜色
public: public: