查看完整版本: [-- 求助,QWebEngineView加载离线地图html文件。 --]

QTCN开发网 -> Qt基础编程 -> 求助,QWebEngineView加载离线地图html文件。 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

automoblie0 2020-05-28 10:56

求助,QWebEngineView加载离线地图html文件。

求助,QWebEngineView加载离线地图html文件时,如下代码已经将离线地图地址加入进来了。
这个test111.html在网页下打开是正常显示离线地图内容。
  1. QString htmlPath = QCoreApplication::applicationDirPath() + "/_GoogleMapAPI3/test111.html";


但在为什么Qt界面上显示却是空的瓦片,并且连google的logo都是问号的图标。
感觉像是资源没有加入进来,求助该如何处理。拜托大家

maxlogo 2020-05-28 11:04
前面还要加file:///

automoblie0 2020-05-28 11:12

你好,我这个已经加过了。。还是之前的问题。。

  1. QString htmlPath = QCoreApplication::applicationDirPath() + "/GoogleMapAPI3/test111.html";
        qDebug() << htmlPath << endl;

        WebEnginePage->load(QUrl("file:///"+htmlPath));
        WebEnginePage->setWebChannel(WebChannel);
        ui->WebEngineView->setPage(WebEnginePage);





查看完整版本: [-- 求助,QWebEngineView加载离线地图html文件。 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled