Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.4
-
None
Description
QQmlEngine has networkAcessManager(), networkAccessManagerFactory(), and setNetworkAccessManagerFactory(), which allow an application to proxy, filter, or entirely disable the QML engine's network access. From the documentation for networkAccessManager:
Returns a common QNetworkAccessManager which can be used by any QML type instantiated by this engine.
For normal QML elements,this makes it easy to create an engine-wide offline mode:
QQmlEngine *myEngine = qmlEngine(myItem); myEngine->networkAccessManager()->setNetworkAccessible(QNetworkAccessManager::NotAccessible);
In comparison, many of the geolocation plugins relied on by the QtLocation QML types create their own private QNAM instances. Without an accessor API, some apparent solutions are application-wide filtering with a QNetworkProxy or QNetworkProxyFactory, or creating a Map with plugin parameters that specify an unreachable tile server. Neither option is graceful.