qt/LedOK/base/waitingdlg.h
2023-04-23 17:01:35 +08:00

35 lines
864 B
C++

#ifndef WAITINGDLG_H
#define WAITINGDLG_H
#include "basedlg.h"
#include "base/customprogressindicator.h"
#include <QLabel>
#include <QNetworkReply>
class WaitingDlg : public BaseDlg {
Q_OBJECT
public:
explicit WaitingDlg(QWidget *parent = nullptr, QString text = 0, QString sucText = 0);
inline void connAbort(QNetworkReply *reply) {
connect(this, &WaitingDlg::rejected, reply, [reply] {
reply->blockSignals(true);
reply->abort();
reply->blockSignals(false);
reply->deleteLater();
});
}
QPushButton *btnAbort;
QLabel *fdText;
QString sucText;
CustomProgressIndicator *mIndicator;
public slots:
void success();
protected:
void timerEvent(QTimerEvent *) override;
private:
int closeTimerId{0};
};
#endif // WAITINGDLG_H