[SailfishDevel] How to get GPS Location in QML

christopher.lamb at thurweb.ch christopher.lamb at thurweb.ch
Mon Oct 28 08:29:46 UTC 2013


Hi Bolek

that's of interest to me as well.

I am at work, so I shouldn't spend too much time on this ...

But I had a quick peak at the sources

https://qt.gitorious.org/qt/qtlocation/source/64ee46398e7285a8cd30f483ab730eb87bf01b33:src/imports/positioning/positioning.cpp

It looks to me that PositionSource is a Location 5.2 type. (But the  
Location bundled with Sailfish is not 5.2 yet)

It that is the case then we have three options

1) wait for Qt 5.2
2) download and compile the Location 5.2 sources, and use those
3) write your own plugin to expose PositionSource to qml. I did this  
on Harmattan 4.7.4 for the SatelitteSourceInfo

I hope to make time this evening to look more closely into this.

mfg

Chris


Zitat von tw_bolek <tw_bolek at op.pl>:

> Hello list,
>  
> I am porting my Harmattan QML applications to Sailfish OS.  I simply  
> need to get GPS Location.  In Qt4.8 / QtQuick1.1 it only took  
> importing QtMobility.location and then using PositionSource. 
>  
> In the latest SailfishOS SDK I tried importing QtLocation 5.0 but it  
> is not found.  PositionSource is an unknown element.
>  
> So.... how do I do in Sailfish OS (in QML only) as simple thing as  
> getting location coordinates from GPS?
>  
> I'll be very grateful if you could guide me, in a simple and  
> straightforward way....  Thank you!
>  
> Bolek




More information about the Devel mailing list