WebEngineDownloadItem QML Type

Provides information about a download. More...

Import Statement: import QtWebEngine 1.4
Since: QtWebEngine 1.1

Properties

Methods

Detailed Description

Stores the state of a download to be used to manage requested downloads.

By default, the download is rejected unless the user explicitly accepts it with WebEngineDownloadItem::accept().

Property Documentation

id : int

Holds the download item's ID.


mimeType : string

Holds the MIME type of the download.

This QML property was introduced in QtWebEngine 1.2.


path : string

Holds the full target path where data is being downloaded to.

The path includes the file name. The default suggested path is the standard download location and file name is deduced not to overwrite already existing files.

The download path can only be set in the WebEngineProfile.onDownloadRequested handler before the download is accepted.

See also WebEngineProfile::downloadRequested() and accept().


receivedBytes : int

Holds the amount of data in bytes that has been downloaded so far.


savePageFormat : enumeration

Describes the format that is used to save a web page.

ConstantDescription
WebEngineDownloadItem.UnknownSaveFormatThis is not a request for downloading a complete web page.
WebEngineDownloadItem.SingleHtmlSaveFormatThe page is saved as a single HTML page. Resources such as images are not saved.
WebEngineDownloadItem.CompleteHtmlSaveFormatThe page is saved as a complete HTML page, for example a directory containing the single HTML page and the resources.
WebEngineDownloadItem.MimeHtmlSaveFormatThe page is saved as a complete web page in the MIME HTML format.

This QML property was introduced in QtWebEngine 1.3.


state : enumeration

Describes the state of the download:

ConstantDescription
WebEngineDownloadItem.DownloadRequestedDownload has been requested, but it has not been accepted yet.
WebEngineDownloadItem.DownloadInProgressDownload is in progress.
WebEngineDownloadItem.DownloadCompletedDownload completed successfully.
WebEngineDownloadItem.DownloadCancelledDownload was cancelled by the user.
WebEngineDownloadItem.DownloadInterruptedDownload has been interrupted (by the server or because of lost connectivity).

totalBytes : int

Holds the total amount of data to download in bytes.

-1 means the total size is unknown.


[read-only] type : enumeration

Describes the requested download's type.

ConstantDescription
WebEngineDownloadItem.AttachmentThe web server's response includes a Content-Disposition header with the attachment directive. If Content-Disposition is present in the reply, the web server is indicating that the client should prompt the user to save the content regardless of the content type. See RFC 2616 section 19.5.1 for details.
WebEngineDownloadItem.DownloadAttributeThe user clicked a link with the download attribute. See HTML download attribute for details.
WebEngineDownloadItem.UserRequestedThe user initiated the download, for example by selecting a web action.
WebEngineDownloadItem.SavePageSaving of the current page was requested (for example by the WebEngineView.SavePage web action).

This QML property was introduced in QtWebEngine 1.4.


Method Documentation

void accept()

Accepts the download request, which will start the download.

See also WebEngineDownloadItem::cancel().


void cancel()

Cancels the download.


© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.