Details
-
Type:
Bug
-
Status: Reported
-
Priority:
P3: Somewhat important
-
Resolution: Unresolved
-
Affects Version/s: 5.12.4
-
Fix Version/s: None
-
Component/s: Location: Maps/Navigation
-
Labels:None
-
Platform/s:
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.