QML PositionSource: PositionSource requires the Symbian Location capability
-
Hi,
I have the following code in QML to extract the user location:
@
PositionSource{
id: positionSource
updateInterval: 1000
active: true
onActiveChanged: {
console.log("Active Changed called")
}onPositionChanged: { console.log(position.coordinate.latitude) } }
@
The code works absolutely fine on the QT Simulator. But when i deploy it on my Nokia C7 i get the following error:
[Qt Message] QGeoPositionInfoSource::createDefaultSource() requires the Symbian Location capability to succeed on the Symbian platform.
[Qt Message] <Unknown File>: QML PositionSource: PositionSource requires the Symbian Location capability to succeed on the Symbian platform.Please help me out and do let me know what does this error mean (because the Maps application on my phone is working fine) and how to resolve it.
Thanks in advance
Ronak[EDIT: code formatting, please wrap in @-tags, Volker]
-
Hi,
I modified the value to the following:
@symbian:TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location@Now i do not get that error :)
But onPositionChanged event (of PositionSource) never gets called on my device (Nokia C7). The code works like charm on the Simulator though.
Please advice..
Thanks
Ronak -
I have no experience in QML code, so can you explain me how you listen to "events" in your code? Do you have to somehow register to the events like you do with the connect method i Qt /C++ ?
I have noticed, that listening to events might somehow timeout if getting a lock on gps position takes too long. You can test for this in the following manner:
Open an app on your device, that sets up gps. This could be Nokia maps or in my case a standard gps tracker. When this app shows you, that you are receiving gps updates (or even shows you the status of the satellites in use) then launch your own application. This way you avoid waiting a long time for getting a lock on gps.
If this works, I might be able to help further. If not, there might be a problem elsewhere in your code and it would help to see more code.
-
-
@ronak.rks: hi, have you had any progress on fixing this? I'm facing the same problem. PositionSource QML element seems never to be able to get the current location.