【问题标题】:QML map - TLS initialization failed ERRORQML 映射 - TLS 初始化失败 ERROR
【发布时间】:2021-03-20 17:03:54
【问题描述】:

我目前正在创建一个能够显示地图的应用程序。在添加更多高级功能之前,我想简单地在应用程序中显示某个区域的地图。为此,我使用了 Qt 示例“Minimal map”中的一些修改代码。 map.qml 文件中的代码:

import QtQuick 2.0
import QtLocation 5.6
import QtPositioning 5.6

Rectangle {
    Plugin {
        id: mapPlugin
        name: "osm" // "mapboxgl", "esri", ...
        // specify plugin parameters if necessary
        // PluginParameter {
        //     name:
        //     value:
        // }
    }

    Map {
        anchors.fill: parent
        plugin: mapPlugin
        center: QtPositioning.coordinate(59.91, 10.75) // Oslo
        zoomLevel: 14
    }
}

我使用 QQuickWidget 显示地图,并将源设置为我的 QML 文件。不幸的是,地图没有显示。 QuickWidget 中仅显示灰色背景和题词(我在帖子中附上了图片)。在 QML 调试器控制台中,我收到了消息:

“QObject:​:​connect(​QQuickWindow,​QDeclarativeGeoMap)​:​无效的nullptr参数”

"QGeoTileProviderOsm:​Tileserver 在 QUrl 禁用(​"​http:​/​/​maps-​redirect.​qt.​io/​osm/​5.​8/​satellite"​)​"​ /p>

“QGeoTileFetcherOsm:​所有提供者都已解决”

“QSslSocket:​:​connectToHostEncrypted:​TLS初始化失败”

"QGeoTileRequestManager:​ 5次获取瓦片失败(​8682,​4766,​14)​5次,放弃。​最后的错误信息是:​'​TLS初始化失败'​"

【问题讨论】:

  • 你可能想念 OpenSSL 库。
  • 也可能是插件使用了过时的磁贴服务器。试试其他地图类型之一
  • @folibis 谢谢!安装此库后,一切正常。

标签: c++ qt qml qt5 qtlocation


【解决方案1】:

如果你的操作系统是windows,你应该安装OpenSSL。 而且您正在使用 osm 插件,因此在运行应用程序时应该连接到互联网。

你的代码在我的系统中运行如下:

【讨论】:

    【解决方案2】:

    我也有这个问题。我认为没有必要安装 Openssl 我在这个[链接][1] 中找到了解决方案 [1]:https://forum.qt.io/topic/118089/error-when-running-minimal-map-example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-16
      • 1970-01-01
      • 1970-01-01
      • 2014-01-09
      相关资源
      最近更新 更多