WebEngineView html have <a>
-
my html have
<a href="/andy_file/static/src/img/del.png" download="w3logo" class="andy_file_Dow">now
my webengineview how to download this file??
how to do
im sorry my English is so bad!!!Moved from Testing - p3c0
-
Hi,
my webengineview how to download this file??
Using WebEngineProfile. It provides these signals which sends a WebEngineDownloadItem. This object provides all information of the item to be downloaded.
So once you createWebEngineProfileyou need to set it to WebEngineView's profile property. Thus when download is requested the signal is triggered inWebEngineProfileand can be handled in its corresponding handler.Here's a minimal example of how it works:
import QtQuick 2.6 import QtQuick.Window 2.2 import QtWebEngine 1.2 Window { visible: true width: 800 height: 500 WebEngineProfile { id: eprofile onDownloadRequested: { var item = download item.path = "/home/userfolder/pic.jpg" item.accept() } } WebEngineView { id: webview url: "http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_download" anchors.fill: parent profile: eprofile } }In above example
onDownloadRequestedis the signal handler where we get access to the download item's object nameddownload. Note that actual downloading only starts when user accept's it. Before accepting download we can set the download path. The defaultpathbefore setting contains download folder + file name. -
Hi,
my webengineview how to download this file??
Using WebEngineProfile. It provides these signals which sends a WebEngineDownloadItem. This object provides all information of the item to be downloaded.
So once you createWebEngineProfileyou need to set it to WebEngineView's profile property. Thus when download is requested the signal is triggered inWebEngineProfileand can be handled in its corresponding handler.Here's a minimal example of how it works:
import QtQuick 2.6 import QtQuick.Window 2.2 import QtWebEngine 1.2 Window { visible: true width: 800 height: 500 WebEngineProfile { id: eprofile onDownloadRequested: { var item = download item.path = "/home/userfolder/pic.jpg" item.accept() } } WebEngineView { id: webview url: "http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_download" anchors.fill: parent profile: eprofile } }In above example
onDownloadRequestedis the signal handler where we get access to the download item's object nameddownload. Note that actual downloading only starts when user accept's it. Before accepting download we can set the download path. The defaultpathbefore setting contains download folder + file name. -
@THEFree set storageName and also httpCacheType to
WebEngineProfile.DiskHttpCache -
@THEFree set storageName and also httpCacheType to
WebEngineProfile.DiskHttpCache -
@THEFree Here you go:
WebEngineProfile { id: eprofile storageName: "MyDefaultProfile" httpCacheType: WebEngineProfile.DiskHttpCache }@p3c0 Maybe you don't know I mean.,i give you image
1:not use WebEngineProfile,i open the software

login

close,-----open again

-----------------------------------------------------------------------------------
2:but now

login

close,-----open again

why is not log on automatically
-
@p3c0 Maybe you don't know I mean.,i give you image
1:not use WebEngineProfile,i open the software

login

close,-----open again

-----------------------------------------------------------------------------------
2:but now

login

close,-----open again

why is not log on automatically
-
@THEFree Have you posted any image ? Image upload in the forum is currently not working. Please upload it to some image hosting site and post the link here.
