This commit is contained in:
朱子楚\zhuzi
2023-07-26 22:06:55 +08:00
parent 42f058ca69
commit 4f27ff41b9
3 changed files with 167 additions and 111 deletions

View File

@ -224,17 +224,14 @@ void FluHttp::download(QString url,QJSValue callable,QString filePath,QVariantMa
connect(reply,&QNetworkReply::downloadProgress,this,[=](qint64 bytesReceived, qint64 bytesTotal){
onDownloadProgress(callable,bytesReceived,bytesTotal);
});
connect(reply,&QNetworkReply::readyRead,this,[=](){
file->write(reply->readAll());
});
loop.exec();
if (reply->error() == QNetworkReply::NoError) {
file->write(reply->readAll());
onSuccess(callable,filePath);
}else{
onError(callable,reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(),reply->errorString());
}
_cache.removeOne(reply);
file->close();
reply->deleteLater();
reply = nullptr;
onFinish(callable);

View File

@ -5,7 +5,7 @@ import FluentUI
Item{
property var radius:[0,0,0,0]
property color color : "#FFFFFF"
property color color : FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
property bool shadow: true
default property alias contentItem: container.data
id:control