HttpDownloader Class | Qt Installer Framework Manual

Qt Installer Framework Manual | HttpDownloader

# HttpDownloader Class

(KDUpdater::HttpDownloader)

The HttpDownloader class is used to download files over FTP, HTTP, or HTTPS. More...

Header: | #include <HttpDownloader>
Inherits: | KDUpdater::FileDownloader

- List of all members, including inherited members

## Public Functions

| HttpDownloader(QObject *parent = 0)
| ~HttpDownloader()

## Reimplemented Public Functions

virtual bool | canDownload() const
virtual HttpDownloader * | clone(QObject *parent = 0) const
virtual QString | downloadedFileName() const
virtual bool | isDownloaded() const
virtual void | setDownloadedFileName(const QString &name)

- 24 public functions inherited from KDUpdater::FileDownloader

## Public Slots

virtual void | cancelDownload()

- 1 public slot inherited from KDUpdater::FileDownloader

## Protected Functions

void | timerEvent(QTimerEvent *event)

## Reimplemented Protected Functions

virtual void | onError()
virtual void | onSuccess()

- 17 protected functions inherited from KDUpdater::FileDownloader

### Additional Inherited Members

- 3 properties inherited from KDUpdater::FileDownloader
- 10 signals inherited from KDUpdater::FileDownloader

## Detailed Description

The HttpDownloader class is used to download files over FTP, HTTP, or HTTPS.

HTTPS is supported if Qt is built with SSL.

## Member Function Documentation

### HttpDownloader::HttpDownloader(QObject *parent = 0)

Creates an HTTP downloader with the parent parent.

### HttpDownloader::~HttpDownloader()

Destroys an HTTP downloader.

Removes the downloaded file if FileDownloader::isAutoRemoveDownloadedFile() returns `true` or FileDownloader::setAutoRemoveDownloadedFile() was called with `true`.

### `[virtual]` bool HttpDownloader::canDownload() const

Reimplemented from FileDownloader::canDownload().

Returns `true` if the file exists and is readable.

### `[virtual slot]` void HttpDownloader::cancelDownload()

Reimplemented from FileDownloader::cancelDownload().

Cancels downloading the file.

### `[virtual]` HttpDownloader *HttpDownloader::clone(QObject *parent = 0) const

Reimplemented from FileDownloader::clone().

Clones the HTTP downloader and assigns it the parent parent. Returns the new HTTP downloader.

### `[virtual]` QString HttpDownloader::downloadedFileName() const

Reimplemented from FileDownloader::downloadedFileName().

Returns the file name of the downloaded file.

See also setDownloadedFileName().

### `[virtual]` bool HttpDownloader::isDownloaded() const

Reimplemented from FileDownloader::isDownloaded().

Returns `true` if the file is downloaded.

### `[virtual protected]` void HttpDownloader::onError()

Reimplemented from FileDownloader::onError().

Closes the destination file if an error occurs during copying and stops the download speed timer.

### `[virtual protected]` void HttpDownloader::onSuccess()

Reimplemented from FileDownloader::onSuccess().

Closes the destination file after it has been successfully copied and stops the download speed timer.

### `[virtual]` void HttpDownloader::setDownloadedFileName(const QString &name)

Reimplemented from FileDownloader::setDownloadedFileName().

Sets the file name of the downloaded file to name.

See also downloadedFileName().

### `[protected]` void HttpDownloader::timerEvent(QTimerEvent *event)

Called when the download timer event event occurs.