NavigationPage.qml Example File
wearable/qml/Navigation/NavigationPage.qml
import QtQuick 2.7
import "../Style"
import "navigation.js" as NavigationData
Item {
Column {
anchors.fill: parent
anchors.margins: 2
spacing: 2
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
height: titleRow.height
color: UIStyle.colorQtGray9
Row {
id: titleRow
spacing: 10
anchors.centerIn: parent
Image {
anchors.verticalCenter: parent.verticalCenter
source: "images/navigation.png"
fillMode: Image.PreserveAspectCrop
}
Text {
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Walking")
font.pixelSize: UIStyle.fontSizeM
font.letterSpacing: 2
color: UIStyle.colorQtGray2
}
}
}
ListModel {
id: routeModel
}
ListView {
id: routeView
width: parent.width
height: parent.height - titleRow.height - parent.spacing
property var imageList: ["straight.png",
"leftturn.png",
"rightturn.png",
"uturn.png",
"start.png",
"end.png"]
clip: true
focus: true
boundsBehavior: Flickable.StopAtBounds
snapMode: ListView.SnapToItem
model: routeModel
delegate: RouteElement {
width: routeView.width
height: routeView.height
}
}
}
Component.onCompleted: {
NavigationData.requestNavigationRoute(routeModel)
}
}