SearchResultView.qml Example File
places/views/SearchResultView.qml
import QtQuick 2.5
import QtLocation 5.6
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
ListView {
id: searchView
width: parent.width
height: parent.height
property variant placeSearchModel
signal showPlaceDetails(variant place, variant distance)
signal showMap()
model: placeSearchModel
delegate: SearchResultDelegate {
onShowPlaceDetails: searchView.showPlaceDetails(place, distance)
onSearchFor: placeSearchModel.searchForText(query);
}
footer:
RowLayout {
width: parent.width
Button {
text: qsTr("Previous")
enabled: placeSearchModel.previousPagesAvailable
onClicked: placeSearchModel.previousPage()
Layout.alignment: Qt.AlignHCenter
}
Button {
text: qsTr("Clear")
onClicked: {
placeSearchModel.reset()
showMap()
}
Layout.alignment: Qt.AlignHCenter
}
Button {
text: qsTr("Next")
enabled: placeSearchModel.nextPagesAvailable
onClicked: placeSearchModel.nextPage()
Layout.alignment: Qt.AlignHCenter
}
}
}