ImageFetcher Class Reference
ImageFetcher handles requests to get images.
More...
#include <imagefetcher.h>
List of all members.
Public Slots |
void | fetchImage (const QUrl &url) |
| Fecth image from given url.
|
Signals |
void | imageReceived (const QUrl &url, const QPixmap &image) |
| Signal which is emitted when image is received from the server and loaded to pixmap.
|
void | error (const int context, const int error) |
| Signals error.
|
Public Member Functions |
| ImageFetcher (NetworkAccessManager *manager, QObject *parent=0) |
| Default constructor.
|
Private Slots |
void | downloadFinished (QNetworkReply *reply) |
| This slot is called when network manager has finished the download. Loads image and emits imageReceived signal with url and image. If there was a error in reply emits error-signal.
|
void | startNextDownload () |
| This slot is called when next download is started. Takes url from queue, sends request and puts request to download queue.
|
Private Attributes |
QList< QNetworkReply * > | m_currentDownloads |
| List of current downloads.
|
QQueue< QUrl > | m_downloadQueue |
| Queue of pending requests.
|
NetworkAccessManager * | m_manager |
| Network access manager.
|
Detailed Description
ImageFetcher handles requests to get images.
- Author:
- Henri Lampela
Constructor & Destructor Documentation
Default constructor.
- Parameters:
-
| manager | QNetworkAccessManager |
| parent | Parent object |
Member Function Documentation
void ImageFetcher::downloadFinished |
( |
QNetworkReply * |
reply |
) |
[private, slot] |
This slot is called when network manager has finished the download. Loads image and emits imageReceived signal with url and image. If there was a error in reply emits error-signal.
- Parameters:
-
void ImageFetcher::error |
( |
const int |
context, |
|
|
const int |
error | |
|
) |
| | [signal] |
Signals error.
- Parameters:
-
| context | error context |
| error | error code |
void ImageFetcher::fetchImage |
( |
const QUrl & |
url |
) |
[slot] |
Fecth image from given url.
- Parameters:
-
void ImageFetcher::imageReceived |
( |
const QUrl & |
url, |
|
|
const QPixmap & |
image | |
|
) |
| | [signal] |
Signal which is emitted when image is received from the server and loaded to pixmap.
- Parameters:
-
| url | URL to image |
| image | image QPixmap |
The documentation for this class was generated from the following files: