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

Location mapview example incorrectly says ssl support is missing on WebAssembly target

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0
    • Examples and Demos
    • None
    • WebAssembly

    Description

      When running the Location / Mapview example on WebAssembly target using a map accessible via https (which is required for WebAssembly), a large text message is overlaid over the map saying:

      The active map type requires (missing) SSL support

      Even though it works.

      The problem seems to come from the following code in main.cpp:

      #if QT_CONFIG(ssl)
          engine.rootContext()->setContextProperty("supportsSsl", QSslSocket::supportsSsl());
      #else
          engine.rootContext()->setContextProperty("supportsSsl", false);
      #endif
      

      QT_CONFIG(ssl) is not defined for WebAssembly target. However, the browser can still download via https.

      Changing it to something like:

      #if QT_CONFIG(ssl)
          engine.rootContext()->setContextProperty("supportsSsl", QSslSocket::supportsSsl());
      #elif defined(__EMSCRIPTEN__)
          engine.rootContext()->setContextProperty("supportsSsl", true);
      #else
          engine.rootContext()->setContextProperty("supportsSsl", false);
      #endif
      

      fixes it, although perhaps not ideal fix.

      Note that to get Location to work on WebAssembly, you need to apply the fix in https://bugreports.qt.io/browse/QTBUG-125248

      Attachments

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

        Activity

          People

            piwierci Piotr WierciƄski
            srcejon Jon Beniston
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes