代码拉取完成,页面将自动刷新
#ifndef WORK_H
#define WORK_H
#include <QObject>
#include <QThreadPool>
#include <QJsonDocument>
#include <QRunnable>
#include "file.h"
#include "define.h"
#include "http.h"
struct MissionInfo
{
QString workPath="";
QString Path="";
QString MD5="";
};
class work:public QObject
{
Q_OBJECT
public:
work(QObject *parent);
~work();
bool dtIsRuning=true;
bool initdone=false;
QString workPath;
void setWorkPath(QString workPath);
void stop();
private:
QString tempPath;
QThreadPool * tpool;
QThread * twork;
QJsonDocument jdc;
void v1();
void v2();
int finishedNum=0;
int totleNum=0;
int step=0;
signals:
void signal_initdone();
void signal_start();
void signal_stop();
void signal_test();
void signal_finished();
void ui_setprogress(int step,int value);
private slots:
void slot_aMissionIsFinished();
void slot_start();
void slot_stop();
void slot_test();
};
class Mission:public QObject,public QRunnable
{
Q_OBJECT
public:
Mission(QObject * parent,MissionInfo missionInfo);
~Mission();
void run();
void stop();
private:
work * tp;
http * h=nullptr;
QFile * f=nullptr;
MissionInfo missionInfo;
QString tempPath=file::getTempPath()+"/download/";
signals:
void signal_finished();
void signal_stop();
private slots:
void slot_dlfinished();
};
#endif // WORK_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。