Obsolete Members for QWebEngineDownloadItem

以下成員源於類 QWebEngineDownloadItem 已過時。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共類型

(obsolete) enum DownloadType { Attachment, DownloadAttribute, UserRequested, SavePage }

公共函數

(obsolete) QString path () const
(obsolete) void setPath (QString path )
(obsolete) QWebEngineDownloadItem::DownloadType type () const

成員類型文檔編製

enum QWebEngineDownloadItem:: DownloadType

This enum is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

描述請求下載的類型。

常量 描述
QWebEngineDownloadItem::Attachment 0 Web 服務器的響應包括 Content-Disposition 頭具有 attachment 指令。若 Content-Disposition 存在於迴復中,Web 服務器指示客戶端應該提示用戶保存內容,不管內容類型。見 RFC 2616 第 19.5.1 節 瞭解細節。
QWebEngineDownloadItem::DownloadAttribute 1 用戶點擊的鏈接具有 download 屬性。
QWebEngineDownloadItem::UserRequested 2 用戶初啓下載,例如通過選擇 Web 操作。
QWebEngineDownloadItem::SavePage 3 請求保存當前頁麵 (例如通過 QWebEnginePage::SavePage Web 動作)。

該枚舉在 Qt 5.8 引入或被修改。

成員函數文檔編製

QString QWebEngineDownloadItem:: path () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

使用 suggestedFileName (), downloadDirectory (),和 downloadFileName () 代替。

Returns 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.

另請參閱 setPath ().

void QWebEngineDownloadItem:: setPath ( QString path )

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

使用 setDownloadDirectory () 和 setDownloadFileName () 代替。

Sets the full target path to download the file to.

The path should also include the file name. The download path can only be set in response to the QWebEngineProfile::downloadRequested () 信號在接受下載前。此後,此函數對下載項狀態不起作用。

另請參閱 path ().

QWebEngineDownloadItem::DownloadType QWebEngineDownloadItem:: type () const

此函數已過時。提供它是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它。

Returns the requested download's type.

注意: This property works unreliably, except for SavePage downloads. Use isSavePageDownload () 代替。

該函數在 Qt 5.8 引入。