qt/LedOK/gutil/qwaitingdlg.h

62 lines
1.3 KiB
C
Raw Normal View History

2023-09-19 11:49:20 +08:00
#ifndef QWAITINGDLG_H
#define QWAITINGDLG_H
#include <QLabel>
#include <QNetworkReply>
#include <QDialog>
class WaitingIndicator : public QWidget {
Q_OBJECT
public:
using QWidget::QWidget;
2025-05-06 18:28:05 +08:00
QColor mColor = 0x0088ff;
2023-09-19 11:49:20 +08:00
public slots:
void success();
protected:
void timerEvent(QTimerEvent * event) override;
void paintEvent(QPaintEvent * event) override;
2025-05-06 18:28:05 +08:00
int angle = 0;
int timerId = 0;
};
class LoadingDlg : public QDialog {
Q_OBJECT
public:
explicit LoadingDlg(QWidget *parent = nullptr, QString text = 0, QString sucText = 0);
QLabel *fdText;
QString sucText;
WaitingIndicator *mIndicator;
int keepTime = 750;
public slots:
void success();
protected:
void timerEvent(QTimerEvent *) override;
void closeEvent(QCloseEvent *) override;
private:
int closeTimerId = 0;
2023-09-19 11:49:20 +08:00
};
class WaitingDlg : public QDialog {
Q_OBJECT
public:
explicit WaitingDlg(QWidget *parent = nullptr, QString text = 0, QString sucText = 0);
QLabel *fdText;
QString sucText;
WaitingIndicator *mIndicator;
int keepTime = 750;
public slots:
void show();
void showLater();
void success();
protected:
void timerEvent(QTimerEvent *) override;
void closeEvent(QCloseEvent *) override;
private:
int closeTimerId{0}, showTimerId{0};
};
#endif // QWAITINGDLG_H