mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 02:52:03 +08:00
2.0.1新建文件夹
This commit is contained in:
37
wine-source/downloadthread.h
Normal file
37
wine-source/downloadthread.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 重写 QThread 以实现多线程下载功能
|
||||
*/
|
||||
#ifndef DOWNLOADTHREAD_H
|
||||
#define DOWNLOADTHREAD_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
#include <QProgressDialog>
|
||||
#include <QListView>
|
||||
#include <QJsonArray>
|
||||
|
||||
class DownloadThread : public QThread // 继承 QThread
|
||||
{
|
||||
public:
|
||||
DownloadThread(QProgressDialog *dialog, QString url, QString save, QString fileName, QListView *view, bool deleteZip, bool unzip, QJsonArray *localList);
|
||||
void SettingVirtualMachine(QString savePath);
|
||||
QProgressDialog *dialog;
|
||||
QString fileUrl;
|
||||
QString fileSaveName;
|
||||
QString fileSavePath;
|
||||
QListView *localView;
|
||||
QJsonArray *localJsonList;
|
||||
bool downloadDeleteZip;
|
||||
bool downloadUnzip;
|
||||
|
||||
protected:
|
||||
void run(); // 核心
|
||||
void ReadLocalInformation();
|
||||
|
||||
signals:
|
||||
// 防止非主线程刷新控件导致程序退出
|
||||
void MessageBoxInfo(QString info);
|
||||
void MessageBoxError(QString info);
|
||||
};
|
||||
|
||||
#endif // DOWNLOADTHREAD_H
|
||||
Reference in New Issue
Block a user