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