main.qml Example File
placepicker/assets/main.qml
import bb.cascades 1.0
import bb.cascades.places 1.0
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
PlacepickerScrollView {
horizontalAlignment: HorizontalAlignment.Fill
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 50
rightPadding: 30
Button {
horizontalAlignment: HorizontalAlignment.Center
text: qsTr("Select Place")
onClicked: placePicker.selectPlace()
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
topMargin: 50
FieldLabel {
title: qsTr("name")
field: "name"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("alternative name")
field: "alternativeName"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("description")
field: "description"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("street")
field: "street"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("city")
field: "city"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("region")
field: "region"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("country")
field: "country"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("postal code")
field: "postal"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("address label")
field: "addressLabel"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("phone")
field: "phone"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("secondary phone")
field: "secondaryPhone"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("fax")
field: "fax"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("email")
field: "email"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("web site")
field: "url"
selectedPlace: placePicker.selectedPlace
}
FieldNumber {
title: qsTr("rating")
field: "rating"
selectedPlace: placePicker.selectedPlace
}
FieldLabel {
title: qsTr("map URL")
field: "mapURL"
selectedPlace: placePicker.selectedPlace
}
FieldNumber {
title: qsTr("latitude")
field: "latitude"
selectedPlace: placePicker.selectedPlace
}
FieldNumber {
title: qsTr("longitude")
field: "longitude"
selectedPlace: placePicker.selectedPlace
}
FieldNumber {
title: qsTr("altitude")
field: "altitude"
selectedPlace: placePicker.selectedPlace
}
}
}
}
}
attachedObjects: [
PlacePicker {
id: placePicker
property variant selectedPlace
function selectPlace()
{
selectedPlace = show()
}
}
]
}