代码拉取完成,页面将自动刷新
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)
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。