places_list.qml Example File
places_list/places_list.qml
import QtQuick 2.0
import QtPositioning 5.5
import QtLocation 5.6
Rectangle {
width: 360
height: 640
property variant startCoordinate: QtPositioning.coordinate( 59.9485, 10.7686)
Plugin {
id: myPlugin
name: "osm"
}
PlaceSearchModel {
id: searchModel
plugin: myPlugin
searchTerm: "pizza"
searchArea: QtPositioning.circle(startCoordinate);
Component.onCompleted: update()
}
ListView {
anchors.fill: parent
model: searchModel
delegate: Component {
Row {
spacing: 5
Marker { height: parent.height }
Column {
Text { text: title; font.bold: true }
Text { text: place.location.address.text }
}
}
}
}
Connections {
target: searchModel
onStatusChanged: {
if (searchModel.status == PlaceSearchModel.Error)
console.log(searchModel.errorString());
}
}
}