5 #include <QNetworkAccessManager>
10 #include "mapfetcher.h"
13 * @brief MapFetcher handles requests to get map tiles.
17 * @class MapFetcher mapfetcher.h "map/mapfetcher.h"
19 class MapFetcher : public QObject
25 * @brief Constructor for MapFetcher.
28 * @param parent parent object
30 MapFetcher(QObject *parent = 0);
35 * @brief Fetch image from given URL.
38 * @param url URL to image
40 void fetchMapImage(const QUrl &url);
44 * @brief Signal which is emitted when a map tile
45 * is received from the server and loaded to pixmap.
47 * @fn mapImageReceived
48 * @param url URL to image
49 * @param image image pixmap
51 void mapImageReceived(const QUrl &url, const QPixmap &image);
54 * @brief Signal which is emitted when there is error
58 * @param message error message
60 void error(const QString &message);
64 * @brief This slot is called when network manager has finished
67 * @fn downloadFinished
70 void downloadFinished(QNetworkReply *reply);
71 void startNextDownload();
74 QNetworkAccessManager m_manager;
75 QList<QNetworkReply *> currentDownloads;
76 QQueue<QUrl> downloadQueue;