Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
feiyangqingyun committed Nov 26, 2019
1 parent 7a00977 commit a805ea1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lightbutton/lightbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -435,7 +436,6 @@ void LightButton::stopAlarm()

void LightButton::alarm()
{
static bool isAlarm = false;
if (isAlarm) {
textColor = QColor(255, 255, 255);
bgColor = normalColor;
Expand Down
1 change: 1 addition & 0 deletions lightbutton/lightbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class LightButton : public QWidget
bool showOverlay; //是否显示遮罩层
QColor overlayColor; //遮罩层颜色

bool isAlarm; //是否报警
QTimer *timerAlarm; //定时器切换颜色

public:
Expand Down

0 comments on commit a805ea1

Please sign in to comment.