1 Star 0 Fork 7

elee/qkuwoplayer

forked from lynnhua/qkuwoplayer 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qhttpdownload.h 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
lynnhua 提交于 2022-10-27 11:18 . change play bug
/******************************************************************
*Company: http://www.xiaomutech.com/
*fileName : qhttpdownload.h --- QHttpDownload
*Auth : yhni (QQ:393320854)
*Create : 2022/9/15
*Description :
*Histroy:
*<Auth> <Date> <Ver> <Content>
* 2022/9/15
*******************************************************************/
#ifndef QHTTPDOWNLOAD_H
#define QHTTPDOWNLOAD_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QFile>
#include <QList>
class DownloadItem;
class QHttpDownload : public QObject
{
Q_OBJECT
public:
explicit QHttpDownload(QObject *parent = nullptr);
~QHttpDownload();
void download(const QString &_url, const QString &_fileName, const QString &_path);
static bool checkAppVersion(const QString &_appName, const quint32 &_appVer, QString &_info);
signals:
void finished(const QString &_fileName);
private slots:
void sltReadyRead();
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
void sltFinished();
void startTask();
private:
QNetworkAccessManager *m_http;
QNetworkReply *m_reply;
QFile m_file;
QList<DownloadItem> m_downTask;
bool m_isDownload;
};
class DownloadItem {
public:
DownloadItem() {}
DownloadItem(const QString &_url, const QString &_name, const QString &_path);
QString url() const;
void setUrl(const QString &url);
QString name() const;
void setName(const QString &name);
QString path() const;
void setPath(const QString &path);
QString filePath() const;
private:
int m_id;
QString m_url;
QString m_name;
QString m_path;
};
#endif // QHTTPDOWNLOAD_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qwert123123/qkuwoplayer.git
git@gitee.com:qwert123123/qkuwoplayer.git
qwert123123
qkuwoplayer
qkuwoplayer
master

搜索帮助