1 Star 0 Fork 0

LiMay/MapDemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
RouteList.qml 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
LiMay 提交于 2021-11-28 15:50 . 导航路线详情内容翻译为中文;
import QtQuick 2.5
import QtQuick.Controls 2.4
import QtQuick.Layouts 1.2
import "helper.js" as Helper
Rectangle{
id:listform
width:360-10*2; height:590
color: "white" //"#ffffffff"
radius: 10;
// 列表的背景图
// Image {
// id: backimg
// width:360-10*2; height:590
// fillMode: Image.PreserveAspectFit
// source: "../resources/kaiping.png"
// }
property string totalTravelTime
property string totalDistance
signal closeForm()
ListView {
//property variant routeModel
id:myList
width:360-10*2; height:590
spacing: 0
interactive: true
model: ListModel { id: routeInfoModel }
header: RouteListHeader {}
delegate: RouteListDelegate{
routeIndex.text: index + 1
routeInstruction.text: instruction
routeDistance.text: distance
}
// footer: Button {
// anchors.horizontalCenter: parent.horizontalCenter
// text: qsTr("Close")
// onClicked: {
// closeForm()
// }
// }
ScrollBar.vertical: ScrollBar { //滚动条
x: 355-6
width: 10
active: true
background: Item { //滚动条的背景样式
Rectangle {
anchors.centerIn: parent
height: parent.height
width: parent.width * 0.2
color: 'grey'
radius: width/2
}
}
contentItem: Rectangle {
radius: width/3 //bar的圆角
color: 'yellow'
}
}
}
function showRouteInfo(routeModel)
{
routeInfoModel.clear()
if (routeModel.count > 0) {
for (var i = 0; i < routeModel.get(0).segments.length; i++)
{
var _ss=map.routeInfo2Chinese(routeModel.get(0).segments[i].maneuver.instructionText)
routeInfoModel.append({
"instruction": _ss,
"distance": Helper.formatDistance(routeModel.get(0).segments[i].maneuver.distanceToNextInstruction)
});
}
}
totalTravelTime = routeModel.count === 0 ? "" : Helper.formatTime(routeModel.get(0).travelTime)
totalDistance = routeModel.count === 0 ? "" : Helper.formatDistance(routeModel.get(0).distance)
}
}
马建仓 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