mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-22 09:42:10 +08:00
c61d1bbce6
old-commit-hash: 1bcc3beae80fd22e9536d8a3538917f327a74085
33 lines
575 B
C++
33 lines
575 B
C++
#include <array>
|
|
|
|
#include <QTimer>
|
|
#include <QLabel>
|
|
#include <QWidget>
|
|
#include <QPixmap>
|
|
#include <QProgressBar>
|
|
#include <QSocketNotifier>
|
|
|
|
constexpr int spinner_fps = 30;
|
|
constexpr QSize spinner_size = QSize(360, 360);
|
|
|
|
class Spinner : public QWidget {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit Spinner(QWidget *parent = 0);
|
|
|
|
private:
|
|
int track_idx;
|
|
QLabel *comma, *track;
|
|
QLabel *text;
|
|
QProgressBar *progress_bar;
|
|
std::array<QPixmap, spinner_fps> track_imgs;
|
|
|
|
QTimer *rotate_timer;
|
|
QSocketNotifier *notifier;
|
|
|
|
public slots:
|
|
void rotate();
|
|
void update(int n);
|
|
};
|