I'm new to both C++ and BB10 development (Cascades), and have been having a difficult time learning Blackberry's semi-implementation of Qt's QML.
I have an app I'm working on and I'd like to get the phone's Latitude, Longitude, and other address related information (City, State, Country, etc). I've tried a few different things, like registering existing C++ classes to be called from QML, but certain things aren't available in the BB10 version of the libraries.
I found that the QtMobilitySubset.location 1.2 library available in Cascades offers PositionSource and Address objects, however I have been unable to get any data from them.
I've included them in the "attachedObjects" portion of the QML document:
attachedObjects: [
PositionSource {
id: positionSource
updateInterval: 5000
active: true
},
Place {
id: place
},
Address {
id: address
}
]
and then tried getting information from address by calling address.state
but get an empty value. Same goes for positionSource.position.coordinate.longitude
-- no value.
I've tried looking at other examples provided by Blackberry, but haven't been able to identify what I'm doing wrong.
Does anyone know of an example which demonstrates using pure QML to get location information?