代码拉取完成,页面将自动刷新
import QtQuick 2.9
import QtLocation 5.6
import QtPositioning 5.6
import QtQuick.Controls 2.4
import "helper.js" as Helper
Rectangle{
height:40
width:360//-20*2
color: "white" //顺序是ARGB
//radius: 10
property int buttonClickCount:0
//property variant routeModel
Button{
id:timedistBtn
x:25; y:5
width:170; height:30
background: Rectangle{
implicitWidth: 170;
implicitHeight: 30;
radius: 10
color: "transparent"
border.width: 1
border.color: "black"
}
onClicked: {
buttonClickCount+=1
// 显示路线详情
//奇数次点击显示 偶数次点击隐藏
buttonClickCount%2==1? navigatePage.showRouteInfoString() : navigatePage.hideRouteInfoForm()
buttonClickCount%2==1? myLocateBtn.visible=false: myLocateBtn.visible=true
}
}
Text{
id:tmdtLabel
x:25; y:5
width:170; height:30
color: "blue"
text:qsTr("")
font.pixelSize: 14
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
}
Button{
id:startNavBtn
x:215; y:5
width:120; height:30
font.pixelSize: 16
background: Rectangle{
implicitWidth: 12;
implicitHeight: 30;
radius: 10
color: "#007de5"
}
contentItem : Text {
color: "white"
font.bold: true
font.pixelSize: 16
text: qsTr("开始导航")
verticalAlignment: Qt.AlignVCenter
horizontalAlignment: Qt.AlignHCenter
}
onClicked: {
// 切换到导航界面
}
}
function displayForm(routeModel)
{
visible=true
var totalTravelTime = routeModel.count === 0 ? "" : Helper.formatTime(routeModel.get(0).travelTime)
var totalDistance = routeModel.count === 0 ? "" : Helper.formatDistance(routeModel.get(0).distance)
tmdtLabel.text= qsTr(totalTravelTime +" "+ totalDistance)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。