> Sent: Tuesday, August 11, 2015 at 8:24 AM
From: "Federico Buti" <bacaro...@gmail.com>
To: "interest@qt-project.org" <interest@qt-project.org>
Subject: [Interest] Qt positioning

Hi list,
 
I was playing around with positioning on Android and I'm not sure if I'm using 
it properly. I would like to update the position of the cellphone/app ASA the 
user taps on a button. To achieve this result I've setup my project as follows:
...

​The idea was to activate the GPS ​only when required, update the value 
(probably with a busy dialog on screen) and deactivate it. I could have used 
the update() method, I know.
Now, if I execute the code on a device with GPS turned off, I've the error 
"PositionSource.ClosedError". Instead, on the same device with GPS turned on 
the position is never updated. The same occurs in a newly created project with 
just this code added.
Qt version is 5.5
What am I missing? What am I doing wrong? The default dialog for GPS activation 
(i.e. the one shown by Googlemaps for instance) is not shown when position 
acquisition is started? 
Thanks everyone for your time,
F.
--------


I've not had any success in iOS or Android. I've got a mobile app that is 
supposed to grab a position and it never does. Here's my setup
main.qml: 
        PositionSource {
                id: positionSource
        }
        Component.onCompleted: {
                positionSource.update();
        }
later (~90s)... on an event handler:
                                if (positionSource.valid)
                                        root.location = {lat: 
positionSource.position.coordinate.latitude, lon: 
positionSource.position.coordinate.longitude};
                                else
                                        root.location = {lat: null, lon: null};

It never goes valid. One thing to note, is in my work environment, my GPS is 
usually on, and has a fix, so it should already be valid.

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to