Skip to main content

class QCefDownloadItem

Represents the download item.

Summary

MembersDescriptions
public ~QCefDownloadItem()Destructs the download item instance.
public void start(const QString & path, bool useDefaultDialog) constStarts to download the item.
public void pause() constPauses the download.
public void resume() constResume the download.
public void cancel() constCancels the download.
public bool isStarted() constGets whether the download is started.
public bool isInProgress() constGets whether the download is in progress.
public bool isComplete() constGets whether the download is complete.
public bool isCanceled() constGets whether the download has been canceled or interrupted.
public qint64 currentSpeed() constGets current download speed.
public int percentComplete() constGets the completion percentage.
public qint64 totalBytes() constGets total number of bytes.
public qint64 receivedBytes() constGets number of received bytes.
public QDateTime startTime() constGets the time that the download started.
public QDateTime endTime() constGets the time that the download ended.
public QString fullPath() constGets the full path to the downloaded or downloading file.
public quint32 id() constGets the unique identifier for this download.
public QString url() constGets the URL.
public QString originalUrl() constGets the original URL before any redirections.
public QString suggestedFileName() constGets the suggested file name.
public QString contentDisposition() constGets the content disposition.
public QString mimeType() constGets the mime type.
private QScopedPointer< QCefDownloadItemPrivate > d_ptr
private QCefDownloadItem(QCefDownloadItem &&) = delete
private QCefDownloadItem&operator=(QCefDownloadItem &&) = delete
private QCefDownloadItem()Constructs a download item instance.

Members


public ~QCefDownloadItem()

Destructs the download item instance.


public void start(const QString & path, bool useDefaultDialog) const

Starts to download the item.

Parameters

  • path The full path name (must include file name) to save the downloaded item

  • useDefaultDialog Whether to use the default 'Save As...' dialog or not

The 'path' parameter only works when 'useDefaultDialog' is set to false. If you set 'useDefaultDialog' to true then you cannot control the initial location of the opened 'Save As...' dialog, it is determined by CEF internal implementation.


public void pause() const

Pauses the download.


public void resume() const

Resume the download.


public void cancel() const

Cancels the download.


public bool isStarted() const

Gets whether the download is started.

Returns


public bool isInProgress() const

Gets whether the download is in progress.

Returns

True if the download is in progress; otherwise false


public bool isComplete() const

Gets whether the download is complete.

Returns

True if the download is complete; otherwise false


public bool isCanceled() const

Gets whether the download has been canceled or interrupted.

Returns

True if the download has been canceled or interrupted; otherwise false


public qint64 currentSpeed() const

Gets current download speed.

Returns

A simple speed estimate in bytes/s


public int percentComplete() const

Gets the completion percentage.

Returns

The rough percent complete or -1 if the receive total size is unknown


public qint64 totalBytes() const

Gets total number of bytes.

Returns

The total number of bytes


public qint64 receivedBytes() const

Gets number of received bytes.

Returns

The number of received bytes


public QDateTime startTime() const

Gets the time that the download started.

Returns

The time that the download started


public QDateTime endTime() const

Gets the time that the download ended.

Returns

The time that the download ended


public QString fullPath() const

Gets the full path to the downloaded or downloading file.

Returns

The full path to the downloaded or downloading file


public quint32 id() const

Gets the unique identifier for this download.

Returns

The unique identifier for this download


public QString url() const

Gets the URL.

Returns

The the URL


public QString originalUrl() const

Gets the original URL before any redirections.

Returns

The original URL before any redirections


public QString suggestedFileName() const

Gets the suggested file name.

Returns

The suggested file name


public QString contentDisposition() const

Gets the content disposition.

Returns

The the content disposition


public QString mimeType() const

Gets the mime type.

Returns

The mime type


private QScopedPointer< QCefDownloadItemPrivate > d_ptr


private QCefDownloadItem(QCefDownloadItem &&) = delete


private QCefDownloadItem&operator=(QCefDownloadItem &&) = delete


private QCefDownloadItem()

Constructs a download item instance.