1 Star 0 Fork 0

AdrianW / SDMonitor_GUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
OfflineBaiduMap.qml 1.80 KB
一键复制 编辑 原始数据 按行查看 历史
AdrianW 提交于 2018-07-27 09:56 . Init Files
import QtQuick 2.0
import QtWebEngine 1.5
import QtWebChannel 1.0
import QtQuick.Controls 2.2
Item{
clip:true
WebChannel{
id:htmlchannel
objectName: "objwebchannel"
registeredObjects:webchannelobject
}
QtObject{
id:webchannelobject
objectName: "objobject"
WebChannel.id: "content"
signal createmarker(var lat, var lng, string msg)
signal clearmarker
function buildingmap(){
console.log("building map")
}
}
WebEngineView {
url:"file://"+RootController.getMcConfigInfo("[MCUIInfo]" , "baidumaphtml")
width: parent.width
height: parent.height
y:-7
x:-7
webChannel: htmlchannel
onLoadProgressChanged: {
if(loadProgress === 100){
createmcmarker.running = true
}
}
}
property string mcinfo: ""
Timer{
id:createmcmarker
interval: 1000
triggeredOnStart: false
running: false
repeat: false
onTriggered: {
console.log("Offline Map Over")
mcinfo = "<h4 style='margin:0 0 5px 0;padding:0.2em 0'>"+RootController.getMcConfigInfo("[MCUIInfo]" , "name")+"</h4>" +
"<img style='float:right;margin:4px' id='imgDemo' src='images/MC.jpg' width='139' height='104' title='天安门'/>" +
"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>"+RootController.getMcConfigInfo("[MCUIInfo]" , "descr")+"</p>" +
"</div>"
webchannelobject.createmarker(RootController.getMcConfigInfo("[MCUIInfo]" , "lat"),
RootController.getMcConfigInfo("[MCUIInfo]" , "lng"),
mcinfo)
}
}
}
1
https://gitee.com/adrianW/SDMonitor_GUI.git
git@gitee.com:adrianW/SDMonitor_GUI.git
adrianW
SDMonitor_GUI
SDMonitor_GUI
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891