mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
进度更新
This commit is contained in:
34
inc/spkloading.h
Normal file
34
inc/spkloading.h
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTimeLine>
|
||||
|
||||
class SpkLoading : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SpkLoading(QWidget *parent = nullptr);
|
||||
virtual void paintEvent(QPaintEvent *e) override;
|
||||
virtual void resizeEvent(QResizeEvent *e) override;
|
||||
|
||||
private:
|
||||
QTimeLine *mAnimTimer;
|
||||
QList<int> mSizeList;
|
||||
int mUserHeight = 0;
|
||||
int dw, dh;
|
||||
double dx, dy;
|
||||
|
||||
public slots:
|
||||
void start() { mAnimTimer->start(); }
|
||||
void stop() { mAnimTimer->stop(); }
|
||||
void Begin() { start(); setVisible(true); }
|
||||
void End() { stop(); setVisible(false); }
|
||||
void setHeight(int h) { mUserHeight = h; }
|
||||
void reset();
|
||||
|
||||
private slots:
|
||||
void timer(int s);
|
||||
void loop();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user