4#include <QtCore/QTimerEvent>
41 const QSet<QGeoTileSpec> &tilesRemoved)
47 cancelTileRequests(tilesRemoved);
49 std::copy(tilesAdded.cbegin(), tilesAdded.cend(), std::back_inserter(
d->queue_));
51 if (
d->enabled_ &&
initialized() && !
d->queue_.isEmpty() && !
d->timer_.isActive())
52 d->timer_.start(0,
this);
55void QGeoTileFetcher::cancelTileRequests(
const QSet<QGeoTileSpec> &tiles)
61 tile_iter tile = tiles.constBegin();
62 tile_iter
end = tiles.constEnd();
63 for (; tile !=
end; ++tile) {
66 d->invmap_.remove(*tile);
71 d->queue_.removeAll(*tile);
75void QGeoTileFetcher::requestNextTile()
84 if (
d->queue_.isEmpty())
88 if (
d->queue_.isEmpty())
95 if (ts.
zoom() < cameraCaps.minimumZoomLevel() || ts.
zoom() > cameraCaps.maximumZoomLevel() || !
fetchingEnabled())
108 d->invmap_.insert(ts,
reply);
112void QGeoTileFetcher::finished()
124 if (!
d->invmap_.contains(spec)) {
129 d->invmap_.remove(spec);
137 if (
event->timerId() !=
d->timer_.timerId()) {
QGeoTileFetcher(QGeoMappingManagerEngine *parent)
virtual bool initialized() const
virtual ~QGeoTileFetcher()
void updateTileRequests(const QSet< QGeoTileSpec > &tilesAdded, const QSet< QGeoTileSpec > &tilesRemoved)
void tileError(const QGeoTileSpec &spec, const QString &errorString)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
virtual bool fetchingEnabled() const
virtual QGeoTiledMapReply * getTileImage(const QGeoTileSpec &spec)=0
void tileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format)
virtual void handleReply(QGeoTiledMapReply *reply, const QGeoTileSpec &spec)
void finished()
This signal is emitted when this reply has finished processing.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
NetworkError error() const
Returns the error that was found during the processing of this request.
virtual void abort()=0
Aborts the operation immediately and close down any network connections still open.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
void deleteLater()
\threadsafe
Combined button and popup list for selecting options.