mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 13:22:04 +08:00
MainWindow::notify 中焦点判断异常,未去除 QStyleSheetStyle 导致错误认为需要隐藏下载管理对话框 Log: 判断 focusIn 事件前排除 QStyleSheetStyle 对象
36 lines
839 B
C++
36 lines
839 B
C++
#ifndef DOWNLOADWORKER_H
|
|
#define DOWNLOADWORKER_H
|
|
|
|
#include <QObject>
|
|
#include <QVector>
|
|
|
|
class DownloadController : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DownloadController(QObject *parent = nullptr);
|
|
|
|
void setFilename(QString filename);
|
|
void startDownload(const QString &url);
|
|
void stopDownload();
|
|
qint64 getFileSize(const QString& url);
|
|
QString replaceDomain(const QString& url, const QString domain);
|
|
|
|
signals:
|
|
void errorOccur(const QString& msg);
|
|
void downloadProcess(QString, qint64, qint64);
|
|
void downloadFinished();
|
|
|
|
private:
|
|
int threadNum;
|
|
qint64 pidNumber = -1;
|
|
QString filename;
|
|
qint64 fileSize;
|
|
QVector<QPair<qint64, qint64>> ranges;
|
|
bool finished = false;
|
|
QVector<QString> domains;
|
|
};
|
|
|
|
#endif // FILEDOWNLOADWORKER_H
|