Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77207

QtLocation geolocation plugins should use the associated QQmlEngine's QNetworkAccessManager

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12.4
    • None
    • All

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paangele Paolo Angelelli
            jkatz_at_volexity Jeremy Katz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes