PIQt now provide PICout << operators for Qt types

MapView::setTileObsoleteTime() method. You can set maximum lifetime for tile, after that it will be redownloaded
This commit is contained in:
2024-09-28 09:15:25 +03:00
parent 2eacbfbfc1
commit dd4695780d
7 changed files with 128 additions and 6 deletions

View File

@@ -46,6 +46,7 @@ public:
add_size_b = mb * 1024 * 1024;
updateCacheSize();
}
void setTileObsoleteTime(int secs) { secs_obsolete = secs; }
void tileDownloaded(OSM::TileIndex index, const QPixmap & pixmap);
OSM::TilePixmap getTile(OSM::TileIndex index, QRectF & rect_src);
@@ -67,6 +68,7 @@ private:
QDir cache_dir;
QWaitCondition cond;
QMutex cond_mutex;
int secs_obsolete = -1;
int fixed_size_b = 0, add_size_b = 0;
QQueue<OSM::TilePixmap> queue;
QCache<quint64, OSM::TilePixmap> tile_cache;