17#include <QStandardPaths>
43 d->fetcher_->deleteLater();
45 d->fetcher_ = fetcher;
47 qRegisterMetaType<QGeoTileSpec>();
78 for (; hi != hend; ++hi) {
83 newTileHash.
remove(hi.key());
85 newTileHash.
insert(hi.key(), maps);
104 tile_iter remEnd = tilesRemoved.
constEnd();
105 for (; rem != remEnd; ++rem) {
110 tile_iter addEnd = tilesAdded.
constEnd();
111 for (;
add != addEnd; ++
add) {
115 d->mapHash_.insert(
map, oldTiles);
123 for (; rem != remEnd; ++rem) {
128 d->tileHash_.remove(*rem);
130 d->tileHash_.insert(*rem, mapSet);
135 for (;
add != addEnd; ++
add) {
141 d->tileHash_.insert(*
add, mapSet);
144 cancelTiles -= reqTiles;
162 for (;
map != mapEnd; ++
map) {
166 d->mapHash_.remove(*
map);
168 d->mapHash_.insert(*
map, tileSet);
171 d->tileHash_.remove(spec);
176 for (;
map != mapEnd; ++
map) {
177 (*map)->requestManager()->tileFetched(spec);
189 for (;
map != mapEnd; ++
map) {
194 d->mapHash_.remove(*
map);
196 d->mapHash_.insert(*
map, tileSet);
198 d->tileHash_.remove(spec);
201 (*map)->requestManager()->tileError(spec, errorString);
216 if (
d->m_tileVersion != version) {
217 d->m_tileVersion = version;
231 return d->m_tileVersion;
237 return d->cacheHint_;
253 cache->setParent(
this);
254 d->tileCache_.reset(
cache);
255 d->tileCache_->init();
261 if (!
d->tileCache_) {
266 d->tileCache_->init();
268 return d->tileCache_.get();
virtual void insert(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format, QAbstractGeoTileCache::CacheAreas areas=QAbstractGeoTileCache::AllCaches)=0
static QString baseLocationCacheDirectory()
QString managerName() const
Returns the name which this engine implementation uses to distinguish itself from the implementations...
void engineInitialized()
Marks the engine as initialized.
void tileError(const QGeoTileSpec &spec, const QString &errorString)
void tileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format)
QHash< QGeoTiledMap *, QSet< QGeoTileSpec > > mapHash_
std::unique_ptr< QAbstractGeoTileCache > tileCache_
QHash< QGeoTileSpec, QSet< QGeoTiledMap * > > tileHash_
void setCacheHint(QAbstractGeoTileCache::CacheAreas cacheHint)
void releaseMap(QGeoTiledMap *map)
QGeoTileFetcher * tileFetcher()
void setTileSize(const QSize &tileSize)
virtual void engineTileError(const QGeoTileSpec &spec, const QString &errorString)
QGeoMap * createMap() override
void setTileFetcher(QGeoTileFetcher *fetcher)
Sets the tile fetcher.
QGeoTiledMappingManagerEngine(QObject *parent=nullptr)
virtual void updateTileRequests(QGeoTiledMap *map, const QSet< QGeoTileSpec > &tilesAdded, const QSet< QGeoTileSpec > &tilesRemoved)
void tileVersionChanged()
QAbstractGeoTileCache * tileCache()
void setTileCache(QAbstractGeoTileCache *cache)
Sets the tile cache.
virtual QSharedPointer< QGeoTileTexture > getTileTexture(const QGeoTileSpec &spec)
void tileError(const QGeoTileSpec &spec, const QString &errorString)
virtual void engineTileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format)
virtual ~QGeoTiledMappingManagerEngine()
Destroys this mapping manager.
QAbstractGeoTileCache::CacheAreas cacheHint() const
QGeoTiledMappingManagerEnginePrivate * d_ptr
void setTileVersion(int version)
bool remove(const Key &key)
Removes the item that has the key from the hash.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void setParent(QObject *parent)
Makes the object a child of parent.
bool remove(const T &value)
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
bool contains(const T &value) const
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QMap< QString, QString > map
[6]
QCache< int, Employee > cache
[0]
Combined button and popup list for selecting options.
static QT_BEGIN_NAMESPACE const int tileSize
#define Q_ARG(Type, data)
GLint GLsizei GLsizei GLenum format
static void add(QPainterPath &path, const QWingedEdge &list, int edge, QPathEdge::Traversal traversal)
#define Q_ASSERT_X(cond, x, msg)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent