Used for Downloading resources from a network.
More...
|
| uint08 | currentDownloadSize () const |
| | Returns the number of bytes downloaded so far.
|
| const QByteArray & | downloadedData () const |
| | Returns the downloaded data.
|
|
void | downloadedSignal () |
| | Emitted when the download completes successfully.
|
|
void | downloadFailedSignal (StringView) |
| | Emitted when a download fails, with an error message.
|
| fltp08 | downloadPercent () const |
| | Returns the download progress as a percentage.
|
|
void | percentChangedSignal () |
| | Emitted when the download progress percentage changes.
|
| void | start (TimeSpan timeout=TimeSpan(10.0)) |
| | Starts the download with an optional timeout.
|
| uint08 | totalDownloadSize () const |
| | Returns the total expected download size.
|
Used for Downloading resources from a network.
Definition at line 178 of file ItemDownloader.h.
◆ ItemDownloader() [1/2]
| ItemDownloader::ItemDownloader |
( |
const StringView & | url, |
|
|
QObject * | parent = nullptr ) |
|
explicitprotected |
◆ ItemDownloader() [2/2]
| ItemDownloader::ItemDownloader |
( |
QUrl | url, |
|
|
QObject * | parent = nullptr ) |
|
explicitprotected |
Constructs an ItemDownloader for the given QUrl.
- Parameters
-
| [in] | url | The URL to download from. |
| [in] | parent | The parent QObject. |
References ItemDownloader().
◆ currentDownloadSize()
| uint08 ItemDownloader::currentDownloadSize |
( |
| ) |
const |
|
inlinenodiscard |
Returns the number of bytes downloaded so far.
- Returns
- The current download size in bytes.
Definition at line 211 of file ItemDownloader.h.
◆ downloadedData()
| const QByteArray & ItemDownloader::downloadedData |
( |
| ) |
const |
|
nodiscard |
Returns the downloaded data.
- Returns
- A const reference to the downloaded QByteArray.
◆ downloadPercent()
| fltp08 ItemDownloader::downloadPercent |
( |
| ) |
const |
|
nodiscard |
Returns the download progress as a percentage.
- Returns
- The download percentage (0.0 to 100.0).
◆ DownloadToFile()
Downloads a file from a URL and saves it to a local path.
- Parameters
-
| [in] | url | The URL to download from. |
| [in] | location | The local file path to save to. |
| [in] | log | Progress tracking object. |
- Returns
- True if the download succeeded.
◆ GetItemDownloader()
◆ HasNetworkManager()
| bool ItemDownloader::HasNetworkManager |
( |
| ) |
|
|
static |
◆ NetworkManager()
◆ SetAccessManager()
Sets the global NetworkAccessManager used for all downloads.
- Parameters
-
| [in] | manager | The network access manager to use. |
◆ setNetworkRequest()
| void ItemDownloader::setNetworkRequest |
( |
const StringView & | url | ) |
|
|
protected |
Configures the internal network request for the given URL.
- Parameters
-
| [in] | url | The URL to set up the request for. |
◆ start()
Starts the download with an optional timeout.
- Parameters
-
| [in] | timeout | The timeout duration before the download is aborted. |
◆ totalDownloadSize()
| uint08 ItemDownloader::totalDownloadSize |
( |
| ) |
const |
|
inlinenodiscard |
Returns the total expected download size.
- Returns
- The total download size in bytes.
Definition at line 216 of file ItemDownloader.h.
The documentation for this class was generated from the following file: