summaryrefslogtreecommitdiffstats
path: root/examples/embedded
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
committerTobias Hunger <tobias.hunger@qt.io>2019-04-16 16:32:08 +0200
commit6630937e63ae5797487b86743a7733c8ae5cc42c (patch)
tree3d53dacf6430f9099e1fb20835881205de674961 /examples/embedded
parent37ed6dae00640f9cc980ffda05347c12a7eb5d7e (diff)
parentc7af193d2e49e9f10b86262e63d8d13abf72b5cf (diff)
Merge commit 'dev' into 'wip/cmake-merge'
Diffstat (limited to 'examples/embedded')
-rw-r--r--examples/embedded/lightmaps/slippymap.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/embedded/lightmaps/slippymap.cpp b/examples/embedded/lightmaps/slippymap.cpp
index ff43261700..da003981ff 100644
--- a/examples/embedded/lightmaps/slippymap.cpp
+++ b/examples/embedded/lightmaps/slippymap.cpp
@@ -162,7 +162,6 @@ void SlippyMap::handleNetworkData(QNetworkReply *reply)
{
QImage img;
QPoint tp = reply->request().attribute(QNetworkRequest::User).toPoint();
- QUrl url = reply->url();
if (!reply->error())
if (!img.load(reply, 0))
img = QImage();
@@ -173,10 +172,12 @@ void SlippyMap::handleNetworkData(QNetworkReply *reply)
emit updated(tileRect(tp));
// purge unused spaces
- QRect bound = m_tilesRect.adjusted(-2, -2, 2, 2);
- foreach(QPoint tp, m_tilePixmaps.keys())
- if (!bound.contains(tp))
- m_tilePixmaps.remove(tp);
+ const QRect bound = m_tilesRect.adjusted(-2, -2, 2, 2);
+ for (auto it = m_tilePixmaps.keyBegin(); it != m_tilePixmaps.keyEnd(); ++it) {
+ const QPoint &tp = *it;
+ if (!bound.contains(tp))
+ m_tilePixmaps.remove(tp);
+ }
download();
}