10 #include <QNetworkAccessManager> 19 : Subpath_ (
std::move (subpath))
20 , CacheSizeGetter_ (
std::move (getter))
23 engine->setNetworkAccessManagerFactory (
this);
28 auto nam =
new QNetworkAccessManager (parent);
31 cache->setMaximumCacheSize (CacheSizeGetter_ ());
32 nam->setCache (cache);
StandardNAMFactory(QString subpath, CacheSizeGetter_f getter, QQmlEngine *engine=nullptr)
Constructs a new StandardNAMFactory.
QNetworkAccessManager * create(QObject *parent) override
Creates the network access manager with the given parent.
A thread-safe garbage-collected network disk cache.
std::function< int()> CacheSizeGetter_f
The type of the function used to query the cache size by the factory.