Trying to make a routing project. Routing is the process of finding the path from an origin to a destination in a street network. You can use the Routing service to find routes, get driving directions, calculate drive times, and solve complicated, multiple vehicle routing problems.
To create a route, I am typically defining a set of stops (origin and one or more destinations) and use the service to find a route with directions. I am also using a number of additional parameters such as barriers and mode of travel to refine the results.
In my model , I want to Create window for displaying the route directions and want to define the platform width of android and ios separately. As for height my both platforms are working fine, but I am not sutre how can I do this? Any ideas.
Below is the code which I want to modify
// Create window for displaying the route directions
Rectangle {
id: directionWindow
anchors {
right: parent.right
top: parent.top
margins: 5
}
radius: 5
ListView {
id: directionsView
anchors {
fill: parent
margins: 5
}
header: Component {
Text {
height: 40
text: "Directions:"
font.pixelSize: 22
}
}
// set the model to the DirectionManeuverListModel returned from the route
model: model.directions
delegate: directionDelegate
}
}
Component {
id: directionDelegate
Rectangle {
id: rect
width: parent.width
height: textDirections.height
color: directionWindow.color
// separator for directions
Shape {
height: 2
ShapePath {
strokeWidth: 1
strokeColor: "darkgrey"
strokeStyle: ShapePath.SolidLine
startX: 20; startY: 0
PathLine { x: parent.width - 20 ; y: 0 }
}
}
Text {
id: textDirections
text: qsTr("%1 (%2 miles)".arg(directionText).arg((length * 0.00062137).toFixed(2)))
wrapMode: Text.WordWrap
anchors {
leftMargin: 5
left: parent.left
right: parent.right
}
}
}
}
CodePudding user response:
You can define your width of screen something like this:
visible: model.directions
width: Qt.platform.os === "ios" || Qt.platform.os === "android" ? 250 : 350
height: parent.height / 2
color: "#FBFBFB"
clip: true