SearchBoundingBox.qml Example File
places/forms/SearchBoundingBox.qml
import QtQuick 2.5
import QtPositioning 5.5
SearchBoundingBoxForm {
property variant searchRegion
signal changeSearchBoundingBox(variant coordinate, real widthDeg, real heightDeg)
signal closeForm()
goButton.onClicked: {
var coordinate = QtPositioning.coordinate(parseFloat(latitude.text),
parseFloat(longitude.text));
if (coordinate.isValid)
changeSearchBoundingBox(coordinate,parseFloat(widthDeg.text),parseFloat(heightDeg.text))
}
clearButton.onClicked: {
latitude.text = ""
longitude.text = ""
widthDeg.text = ""
heightDeg.text = ""
}
cancelButton.onClicked: closeForm()
Component.onCompleted: {
latitude.text = "" + searchRegion.center.latitude
longitude.text = "" + searchRegion.center.longitude
widthDeg.text = searchRegion.width ? "" + searchRegion.width : "0.0"
heightDeg.text = searchRegion.height ? "" + searchRegion.height: "0.0"
}
}