<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qwebenginedownloaditem.cpp --> <title>QWebEngineDownloadItem Class | Qt WebEngine 5.11</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qtwebengine-index.html">Qt WebEngine</a></td><td ><a href="qtwebengine-modules.html">C++ Classes</a></td><td >QWebEngineDownloadItem</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.11.2 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#public-slots">Public Slots</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> <li class="level2"><a href="#object-life-cycle">Object Life Cycle</a></li> <li class="level2"><a href="#web-page-downloads">Web Page Downloads</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QWebEngineDownloadItem Class</h1> <!-- $$$QWebEngineDownloadItem-brief --> <p>The <a href="qwebenginedownloaditem.html">QWebEngineDownloadItem</a> class provides information about a download. <a href="#details">More...</a></p> <!-- @@@QWebEngineDownloadItem --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QWebEngineDownloadItem></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += webenginewidgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.5</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr></table></div><ul> <li><a href="qwebenginedownloaditem-members.html">List of all members, including inherited members</a></li> <li><a href="qwebenginedownloaditem-obsolete.html">Obsolete members</a></li> </ul> <a name="public-types"></a> <h2 id="public-types">Public Types</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#DownloadInterruptReason-enum">DownloadInterruptReason</a></b> { NoReason, FileFailed, FileAccessDenied, FileNoSpace, ..., UserCanceled }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadState</a></b> { DownloadRequested, DownloadInProgress, DownloadCompleted, DownloadCancelled, DownloadInterrupted }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#SavePageFormat-enum">SavePageFormat</a></b> { UnknownSaveFormat, SingleHtmlSaveFormat, CompleteHtmlSaveFormat, MimeHtmlSaveFormat }</td></tr> </table></div> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> quint32 </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#id">id</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebEngineDownloadItem::DownloadInterruptReason </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#interruptReason">interruptReason</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#interruptReasonString">interruptReasonString</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#isFinished">isFinished</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#isPaused">isPaused</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#isSavePageDownload">isSavePageDownload</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#mimeType">mimeType</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#path">path</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#receivedBytes">receivedBytes</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebEngineDownloadItem::SavePageFormat </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#savePageFormat">savePageFormat</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#setPath">setPath</a></b>(QString <i>path</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#setSavePageFormat">setSavePageFormat</a></b>(QWebEngineDownloadItem::SavePageFormat <i>format</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QWebEngineDownloadItem::DownloadState </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#state">state</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#totalBytes">totalBytes</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#url">url</a></b>() const</td></tr> </table></div> <ul> <li class="fn">34 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li> </ul> <a name="public-slots"></a> <h2 id="public-slots">Public Slots</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#accept">accept</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#cancel">cancel</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#pause">pause</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#resume">resume</a></b>()</td></tr> </table></div> <ul> <li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li> </ul> <a name="signals"></a> <h2 id="signals">Signals</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#downloadProgress">downloadProgress</a></b>(qint64 <i>bytesReceived</i>, qint64 <i>bytesTotal</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#finished">finished</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#isPausedChanged">isPausedChanged</a></b>(bool <i>isPaused</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwebenginedownloaditem.html#stateChanged">stateChanged</a></b>(QWebEngineDownloadItem::DownloadState <i>state</i>)</td></tr> </table></div> <ul> <li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li> <li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li> <li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li> <li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li> <li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li> </ul> <a name="details"></a> <!-- $$$QWebEngineDownloadItem-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qwebenginedownloaditem.html">QWebEngineDownloadItem</a> class provides information about a download.</p> <p><a href="qwebenginedownloaditem.html">QWebEngineDownloadItem</a> models a download throughout its life cycle, starting with a pending download request and finishing with a completed download. It can be used, for example, to get information about new downloads, to monitor progress, and to pause, resume, and cancel downloads.</p> <p>Downloads are usually triggered by user interaction on a web page. It is the <a href="qwebengineprofile.html">QWebEngineProfile</a>'s responsibility to notify the application of new download requests, which it does by emitting the <a href="qwebengineprofile.html#downloadRequested">downloadRequested</a> signal together with a newly created <a href="qwebenginedownloaditem.html">QWebEngineDownloadItem</a>. The application can then examine this item and decide whether to accept it or not. A signal handler must explicitly call <a href="qwebenginedownloaditem.html#accept">accept</a>() on the item for Qt WebEngine to actually start downloading and writing data to disk. If no signal handler calls <a href="qwebenginedownloaditem.html#accept">accept</a>(), then the download request will be automatically rejected and nothing will be written to disk.</p> <p><b>Note: </b>Some properties, like the <a href="qwebenginedownloaditem.html#path">path</a> under which the file will be saved, can only be changed before calling <a href="qwebenginedownloaditem.html#accept">accept</a>().</p><a name="object-life-cycle"></a> <h4 >Object Life Cycle</h4> <p>All items are guaranteed to be valid during the emission of the <a href="qwebengineprofile.html#downloadRequested">downloadRequested</a> signal. If <a href="qwebenginedownloaditem.html#accept">accept</a>() is <i>not</i> called by any signal handler, then the item will be deleted <i>immediately</i> after signal emission. This means that the application <b>must not</b> keep references to rejected download items. It also means the application should not use a queued connection to this signal.</p> <p>If <a href="qwebenginedownloaditem.html#accept">accept</a>() <i>is</i> called by a signal handler, then the <a href="qwebengineprofile.html">QWebEngineProfile</a> will take ownership of the item. However, it is safe for the application to delete the item at any time, except during the handling of the <a href="qwebengineprofile.html#downloadRequested">downloadRequested</a> signal. The <a href="qwebengineprofile.html">QWebEngineProfile</a> being a long-lived object, it is in fact recommended that the application delete any items it is no longer interested in.</p> <p><b>Note: </b>Deleting an item will not cancel a possible ongoing download. If that is desirable, then <a href="qwebenginedownloaditem.html#cancel">cancel</a>() must be called separately.</p><a name="web-page-downloads"></a> <h4 >Web Page Downloads</h4> <p>In addition to normal file downloads, which consist simply of retrieving some raw bytes from the network and writing them to disk, Qt WebEngine also supports saving complete web pages, which involves parsing the page's HTML, downloading any dependent resources, and potentially packaging everything into a special file format (<a href="qwebenginedownloaditem.html#savePageFormat">savePageFormat</a>). To check if a download is for a file or a web page, use <a href="qwebenginedownloaditem.html#isSavePageDownload">isSavePageDownload</a>.</p> </div> <p><b>See also </b><a href="qwebengineprofile.html">QWebEngineProfile</a>, <a href="qwebengineprofile.html#downloadRequested">QWebEngineProfile::downloadRequested</a>, <a href="qwebenginepage.html#download">QWebEnginePage::download</a>, and <a href="qwebenginepage.html#save">QWebEnginePage::save</a>.</p> <!-- @@@QWebEngineDownloadItem --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$DownloadInterruptReason$$$NoReason$$$FileFailed$$$FileAccessDenied$$$FileNoSpace$$$FileNameTooLong$$$FileTooLarge$$$FileVirusInfected$$$FileTransientError$$$FileBlocked$$$FileSecurityCheckFailed$$$FileTooShort$$$FileHashMismatch$$$NetworkFailed$$$NetworkTimeout$$$NetworkDisconnected$$$NetworkServerDown$$$NetworkInvalidRequest$$$ServerFailed$$$ServerBadContent$$$ServerUnauthorized$$$ServerCertProblem$$$ServerForbidden$$$ServerUnreachable$$$UserCanceled --> <h3 class="fn" id="DownloadInterruptReason-enum"><a name="DownloadInterruptReason-enum"></a>enum QWebEngineDownloadItem::<span class="name">DownloadInterruptReason</span></h3> <p>Describes the reason why a download was interrupted:</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::NoReason</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Unknown reason or not interrupted.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileFailed</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">General file operation failure.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileAccessDenied</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The file cannot be written locally, due to access restrictions.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileNoSpace</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Insufficient space on the target drive.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileNameTooLong</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The directory or file name is too long.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileTooLarge</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The file size exceeds the file system limitation.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileVirusInfected</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">The file is infected with a virus.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileTransientError</code></td><td class="topAlign tblval"><code>10</code></td><td class="topAlign">Temporary problem (for example the file is in use, out of memory, or too many files are opened at once).</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileBlocked</code></td><td class="topAlign tblval"><code>11</code></td><td class="topAlign">The file was blocked due to local policy.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileSecurityCheckFailed</code></td><td class="topAlign tblval"><code>12</code></td><td class="topAlign">An attempt to check the safety of the download failed due to unexpected reasons.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileTooShort</code></td><td class="topAlign tblval"><code>13</code></td><td class="topAlign">An attempt was made to seek past the end of a file when opening a file (as part of resuming a previously interrupted download).</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::FileHashMismatch</code></td><td class="topAlign tblval"><code>14</code></td><td class="topAlign">The partial file did not match the expected hash.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::NetworkFailed</code></td><td class="topAlign tblval"><code>20</code></td><td class="topAlign">General network failure.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::NetworkTimeout</code></td><td class="topAlign tblval"><code>21</code></td><td class="topAlign">The network operation has timed out.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::NetworkDisconnected</code></td><td class="topAlign tblval"><code>22</code></td><td class="topAlign">The network connection has been terminated.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::NetworkServerDown</code></td><td class="topAlign tblval"><code>23</code></td><td class="topAlign">The server has gone down.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::NetworkInvalidRequest</code></td><td class="topAlign tblval"><code>24</code></td><td class="topAlign">The network request was invalid (for example, the original or redirected URL is invalid, has an unsupported scheme, or is disallowed by policy).</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::ServerFailed</code></td><td class="topAlign tblval"><code>30</code></td><td class="topAlign">General server failure.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::ServerBadContent</code></td><td class="topAlign tblval"><code>33</code></td><td class="topAlign">The server does not have the requested data.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::ServerUnauthorized</code></td><td class="topAlign tblval"><code>34</code></td><td class="topAlign">The server did not authorize access to the resource.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::ServerCertProblem</code></td><td class="topAlign tblval"><code>35</code></td><td class="topAlign">A problem with the server certificate occurred.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::ServerForbidden</code></td><td class="topAlign tblval"><code>36</code></td><td class="topAlign">Access forbidden by the server.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::ServerUnreachable</code></td><td class="topAlign tblval"><code>37</code></td><td class="topAlign">Unexpected server response (might indicate that the responding server may not be the intended server).</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::UserCanceled</code></td><td class="topAlign tblval"><code>40</code></td><td class="topAlign">The user canceled the download.</td></tr> </table></div> <p>This enum was introduced or modified in Qt 5.9.</p> <!-- @@@DownloadInterruptReason --> <!-- $$$DownloadState$$$DownloadRequested$$$DownloadInProgress$$$DownloadCompleted$$$DownloadCancelled$$$DownloadInterrupted --> <h3 class="fn" id="DownloadState-enum"><a name="DownloadState-enum"></a>enum QWebEngineDownloadItem::<span class="name">DownloadState</span></h3> <p>This enum describes the state of the download:</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::DownloadRequested</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Download has been requested, but has not been accepted yet.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::DownloadInProgress</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Download is in progress.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::DownloadCompleted</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Download completed successfully.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::DownloadCancelled</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">Download has been cancelled.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::DownloadInterrupted</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Download has been interrupted (by the server or because of lost connectivity).</td></tr> </table></div> <!-- @@@DownloadState --> <!-- $$$SavePageFormat$$$UnknownSaveFormat$$$SingleHtmlSaveFormat$$$CompleteHtmlSaveFormat$$$MimeHtmlSaveFormat --> <h3 class="fn" id="SavePageFormat-enum"><a name="SavePageFormat-enum"></a>enum QWebEngineDownloadItem::<span class="name">SavePageFormat</span></h3> <p>This enum describes the format that is used to save a web page.</p> <div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::UnknownSaveFormat</code></td><td class="topAlign tblval"><code>-1</code></td><td class="topAlign">This is not a request for downloading a complete web page.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::SingleHtmlSaveFormat</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The page is saved as a single HTML page. Resources such as images are not saved.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::CompleteHtmlSaveFormat</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The page is saved as a complete HTML page, for example a directory containing the single HTML page and the resources.</td></tr> <tr><td class="topAlign"><code>QWebEngineDownloadItem::MimeHtmlSaveFormat</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The page is saved as a complete web page in the MIME HTML format.</td></tr> </table></div> <p>This enum was introduced or modified in Qt 5.7.</p> <!-- @@@SavePageFormat --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$accept[overload1]$$$accept --> <h3 class="fn" id="accept"><a name="accept"></a><code>[slot] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">accept</span>()</h3> <p>Accepts the current download request, which will start the download.</p> <p>If the item is in the <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadRequested</a> state, then it will transition into the <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadInProgress</a> state and the downloading will begin. If the item is in any other state, then nothing will happen.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#finished">finished</a>() and <a href="qwebenginedownloaditem.html#stateChanged">stateChanged</a>().</p> <!-- @@@accept --> <!-- $$$cancel[overload1]$$$cancel --> <h3 class="fn" id="cancel"><a name="cancel"></a><code>[slot] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">cancel</span>()</h3> <p>Cancels the current download.</p> <p>If the item is in the <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadInProgress</a> state, then it will transition into the <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadCancelled</a> state, the downloading will stop, and partially downloaded files will be deleted from disk.</p> <p>If the item is in the <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadCompleted</a> state, then nothing will happen. If the item is in any other state, then it will transition into the <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadCancelled</a> state without further effect.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#finished">finished</a>() and <a href="qwebenginedownloaditem.html#stateChanged">stateChanged</a>().</p> <!-- @@@cancel --> <!-- $$$downloadProgress[overload1]$$$downloadProgressqint64qint64 --> <h3 class="fn" id="downloadProgress"><a name="downloadProgress"></a><code>[signal] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">downloadProgress</span>(<span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> <i>bytesReceived</i>, <span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> <i>bytesTotal</i>)</h3> <p>This signal is emitted to indicate the progress of the download request.</p> <p>The <i>bytesReceived</i> parameter indicates the number of bytes received, while <i>bytesTotal</i> indicates the total number of bytes expected to be downloaded. If the size of the file to be downloaded is not known, <code>bytesTotal</code> will be 0.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#totalBytes">totalBytes</a>() and <a href="qwebenginedownloaditem.html#receivedBytes">receivedBytes</a>().</p> <!-- @@@downloadProgress --> <!-- $$$finished[overload1]$$$finished --> <h3 class="fn" id="finished"><a name="finished"></a><code>[signal] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">finished</span>()</h3> <p>This signal is emitted when the download finishes.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#state">state</a>() and <a href="qwebenginedownloaditem.html#isFinished">isFinished</a>().</p> <!-- @@@finished --> <!-- $$$id[overload1]$$$id --> <h3 class="fn" id="id"><a name="id"></a><span class="type"><a href="../qtcore/qtglobal.html#quint32-typedef">quint32</a></span> QWebEngineDownloadItem::<span class="name">id</span>() const</h3> <p>Returns the download item's ID.</p> <!-- @@@id --> <!-- $$$interruptReason[overload1]$$$interruptReason --> <h3 class="fn" id="interruptReason"><a name="interruptReason"></a><span class="type"><a href="qwebenginedownloaditem.html#DownloadInterruptReason-enum">QWebEngineDownloadItem::DownloadInterruptReason</a></span> QWebEngineDownloadItem::<span class="name">interruptReason</span>() const</h3> <p>Returns the reason why the download was interrupted.</p> <p>This function was introduced in Qt 5.9.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#interruptReasonString">interruptReasonString</a>().</p> <!-- @@@interruptReason --> <!-- $$$interruptReasonString[overload1]$$$interruptReasonString --> <h3 class="fn" id="interruptReasonString"><a name="interruptReasonString"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QWebEngineDownloadItem::<span class="name">interruptReasonString</span>() const</h3> <p>Returns a human-readable description of the reason for interrupting the download.</p> <p>This function was introduced in Qt 5.9.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#interruptReason">interruptReason</a>().</p> <!-- @@@interruptReasonString --> <!-- $$$isFinished[overload1]$$$isFinished --> <h3 class="fn" id="isFinished"><a name="isFinished"></a><span class="type">bool</span> QWebEngineDownloadItem::<span class="name">isFinished</span>() const</h3> <p>Returns whether this download is finished (completed, cancelled, or non-resumable interrupted state).</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#finished">finished</a>() and <a href="qwebenginedownloaditem.html#state">state</a>().</p> <!-- @@@isFinished --> <!-- $$$isPaused[overload1]$$$isPaused --> <h3 class="fn" id="isPaused"><a name="isPaused"></a><span class="type">bool</span> QWebEngineDownloadItem::<span class="name">isPaused</span>() const</h3> <p>Returns whether this download is paused.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#pause">pause</a>() and <a href="qwebenginedownloaditem.html#resume">resume</a>().</p> <!-- @@@isPaused --> <!-- $$$isPausedChanged[overload1]$$$isPausedChangedbool --> <h3 class="fn" id="isPausedChanged"><a name="isPausedChanged"></a><code>[signal] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">isPausedChanged</span>(<span class="type">bool</span> <i>isPaused</i>)</h3> <p>This signal is emitted whenever <i>isPaused</i> changes.</p> <p>This function was introduced in Qt 5.10.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#pause">pause</a>() and <a href="qwebenginedownloaditem.html#isPaused">isPaused</a>().</p> <!-- @@@isPausedChanged --> <!-- $$$isSavePageDownload[overload1]$$$isSavePageDownload --> <h3 class="fn" id="isSavePageDownload"><a name="isSavePageDownload"></a><span class="type">bool</span> QWebEngineDownloadItem::<span class="name">isSavePageDownload</span>() const</h3> <p>Returns <code>true</code> if this is a download request for saving a web page.</p> <p>This function was introduced in Qt 5.11.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#savePageFormat">savePageFormat</a>() and <a href="qwebenginedownloaditem.html#setSavePageFormat">setSavePageFormat</a>().</p> <!-- @@@isSavePageDownload --> <!-- $$$mimeType[overload1]$$$mimeType --> <h3 class="fn" id="mimeType"><a name="mimeType"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QWebEngineDownloadItem::<span class="name">mimeType</span>() const</h3> <p>Returns the MIME type of the download.</p> <p>This function was introduced in Qt 5.6.</p> <!-- @@@mimeType --> <!-- $$$path[overload1]$$$path --> <h3 class="fn" id="path"><a name="path"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QWebEngineDownloadItem::<span class="name">path</span>() const</h3> <p>Returns the full target path where data is being downloaded to.</p> <p>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.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#setPath">setPath</a>().</p> <!-- @@@path --> <!-- $$$pause[overload1]$$$pause --> <h3 class="fn" id="pause"><a name="pause"></a><code>[slot] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">pause</span>()</h3> <p>Pauses the download.</p> <p>Has no effect if the state is not <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadInProgress</a>. Does not change the state.</p> <p>This function was introduced in Qt 5.10.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#resume">resume</a>() and <a href="qwebenginedownloaditem.html#isPaused">isPaused</a>().</p> <!-- @@@pause --> <!-- $$$receivedBytes[overload1]$$$receivedBytes --> <h3 class="fn" id="receivedBytes"><a name="receivedBytes"></a><span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> QWebEngineDownloadItem::<span class="name">receivedBytes</span>() const</h3> <p>Returns the amount of data in bytes that has been downloaded so far.</p> <p><code>-1</code> means the size is unknown.</p> <!-- @@@receivedBytes --> <!-- $$$resume[overload1]$$$resume --> <h3 class="fn" id="resume"><a name="resume"></a><code>[slot] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">resume</span>()</h3> <p>Resumes the current download if it was paused or interrupted.</p> <p>Has no effect if the state is not <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadInProgress</a> or <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadInterrupted</a>. Does not change the state.</p> <p>This function was introduced in Qt 5.10.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#pause">pause</a>(), <a href="qwebenginedownloaditem.html#isPaused">isPaused</a>(), and <a href="qwebenginedownloaditem.html#state">state</a>().</p> <!-- @@@resume --> <!-- $$$savePageFormat[overload1]$$$savePageFormat --> <h3 class="fn" id="savePageFormat"><a name="savePageFormat"></a><span class="type"><a href="qwebenginedownloaditem.html#SavePageFormat-enum">QWebEngineDownloadItem::SavePageFormat</a></span> QWebEngineDownloadItem::<span class="name">savePageFormat</span>() const</h3> <p>Returns the format the web page will be saved in if this is a download request for a web page.</p> <p>This function was introduced in Qt 5.7.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#setSavePageFormat">setSavePageFormat</a>() and <a href="qwebenginedownloaditem.html#isSavePageDownload">isSavePageDownload</a>().</p> <!-- @@@savePageFormat --> <!-- $$$setPath[overload1]$$$setPathQString --> <h3 class="fn" id="setPath"><a name="setPath"></a><span class="type">void</span> QWebEngineDownloadItem::<span class="name">setPath</span>(<span class="type"><a href="../qtcore/qstring.html">QString</a></span> <i>path</i>)</h3> <p>Sets the full target path to download the file to.</p> <p>The <i>path</i> should also include the file name. The download path can only be set in response to the <a href="qwebengineprofile.html#downloadRequested">QWebEngineProfile::downloadRequested</a>() signal before the download is accepted. Past that point, this function has no effect on the download item's state.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#path">path</a>().</p> <!-- @@@setPath --> <!-- $$$setSavePageFormat[overload1]$$$setSavePageFormatQWebEngineDownloadItem::SavePageFormat --> <h3 class="fn" id="setSavePageFormat"><a name="setSavePageFormat"></a><span class="type">void</span> QWebEngineDownloadItem::<span class="name">setSavePageFormat</span>(<span class="type"><a href="qwebenginedownloaditem.html#SavePageFormat-enum">QWebEngineDownloadItem::SavePageFormat</a></span> <i>format</i>)</h3> <p>Sets the <i>format</i> the web page will be saved in if this is a download request for a web page.</p> <p>This function was introduced in Qt 5.7.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#savePageFormat">savePageFormat</a>() and <a href="qwebenginedownloaditem.html#isSavePageDownload">isSavePageDownload</a>().</p> <!-- @@@setSavePageFormat --> <!-- $$$state[overload1]$$$state --> <h3 class="fn" id="state"><a name="state"></a><span class="type"><a href="qwebenginedownloaditem.html#DownloadState-enum">QWebEngineDownloadItem::DownloadState</a></span> QWebEngineDownloadItem::<span class="name">state</span>() const</h3> <p>Returns the download item's current state.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadState</a>.</p> <!-- @@@state --> <!-- $$$stateChanged[overload1]$$$stateChangedQWebEngineDownloadItem::DownloadState --> <h3 class="fn" id="stateChanged"><a name="stateChanged"></a><code>[signal] </code><span class="type">void</span> QWebEngineDownloadItem::<span class="name">stateChanged</span>(<span class="type"><a href="qwebenginedownloaditem.html#DownloadState-enum">QWebEngineDownloadItem::DownloadState</a></span> <i>state</i>)</h3> <p>This signal is emitted whenever the download's <i>state</i> changes.</p> <p><b>See also </b><a href="qwebenginedownloaditem.html#state">state</a>() and <a href="qwebenginedownloaditem.html#DownloadState-enum">DownloadState</a>.</p> <!-- @@@stateChanged --> <!-- $$$totalBytes[overload1]$$$totalBytes --> <h3 class="fn" id="totalBytes"><a name="totalBytes"></a><span class="type"><a href="../qtcore/qtglobal.html#qint64-typedef">qint64</a></span> QWebEngineDownloadItem::<span class="name">totalBytes</span>() const</h3> <p>Returns the the total amount of data to download in bytes.</p> <p><code>-1</code> means the size is unknown.</p> <!-- @@@totalBytes --> <!-- $$$url[overload1]$$$url --> <h3 class="fn" id="url"><a name="url"></a><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> QWebEngineDownloadItem::<span class="name">url</span>() const</h3> <p>Returns the download's origin URL.</p> <!-- @@@url --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br/> 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. </p> </div> </body> </html>