1 Star 0 Fork 0

LiMay/MapDemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ResultPage.qml 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
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)
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/AeroMap/map-demo.git
git@gitee.com:AeroMap/map-demo.git
AeroMap
map-demo
MapDemo
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385