qt/LedOK/program/gentmpthread.h

34 lines
1.1 KiB
C
Raw Normal View History

2022-10-27 15:07:45 +08:00
#ifndef GENTMPTHREAD_H
#define GENTMPTHREAD_H
2022-01-04 18:11:48 +08:00
#include <QThread>
2022-10-27 15:07:45 +08:00
class ProgItem;
class GenTmpThread : public QThread {
2022-01-04 18:11:48 +08:00
Q_OBJECT
public:
2022-10-27 15:07:45 +08:00
explicit GenTmpThread(ProgItem *progItem, const QString &prog_name, const QString &zip_file, const QString &password, QObject *parent = nullptr);
2022-01-04 18:11:48 +08:00
2022-10-27 15:07:45 +08:00
ProgItem *mProgItem;
2022-01-04 18:11:48 +08:00
protected:
2022-08-25 18:37:24 +08:00
virtual void run() override;
2022-01-04 18:11:48 +08:00
2023-04-18 14:14:46 +08:00
QJsonObject cvtPage(const QJsonDocument &, const QJsonDocument &);
2022-08-25 18:37:24 +08:00
QJsonObject cvtEle(const QString &type, const QJsonObject &json);
QJsonObject convertText(const QJsonObject &json);
QJsonObject convertPhoto(const QJsonObject &json);
QJsonObject convertGif(const QJsonObject &json);
QJsonObject convertDClock(const QJsonObject &json);
QJsonObject convertAClock(const QJsonObject &json);
QJsonObject convertWeb(const QJsonObject &json);
QJsonObject convertTimer(const QJsonObject &json);
2022-01-04 18:11:48 +08:00
signals:
void sProgress(QString, int, bool = false);
2023-04-18 14:14:46 +08:00
void onErr(QString);
2022-01-04 18:11:48 +08:00
private:
2022-08-25 18:37:24 +08:00
QString prog_name, dstDir, srcPageDir;
QString zip_file, password;
int res_id = 0;
2022-01-04 18:11:48 +08:00
};
2022-10-27 15:07:45 +08:00
#endif // GENTMPTHREAD_H