Update 更新文档
This commit is contained in:
26
cleaned_source_code/QMainwindow/QBreathingLight.h
Normal file
26
cleaned_source_code/QMainwindow/QBreathingLight.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
#include <QTimer>
|
||||
#include <QColor>
|
||||
#include <QTime>
|
||||
class QBreathingLight : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QBreathingLight(QWidget *parent = nullptr);
|
||||
void setFlashDuration(int milliseconds);
|
||||
void setFlashColor(const QColor &color);
|
||||
public slots:
|
||||
void triggerSignal();
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
private slots:
|
||||
void updateAnimation();
|
||||
private:
|
||||
float m_opacity;
|
||||
bool m_isFlashing;
|
||||
QTimer m_animationTimer;
|
||||
QColor m_flashColor;
|
||||
QTime m_flashStartTime;
|
||||
int m_flashDuration;
|
||||
};
|
||||
Reference in New Issue
Block a user