detecting status ("on"/"off") of location services



  • I'm trying detect current status of GPS (is user turned "on"/"off" location services on device). the problem with detecting "on" status cause QGeoPositionInfoSource::error() continue returns QGeoPositionInfoSource::ClosedError after user turned location "on" (while QtPositioning module detects that services are on, it immediately prints to output: "D QtPositioning: Enabled provider: gps" so i want somehow get that signal)



  • @morte are you sure data is not resuming once location service is turned on again ?

    Just guessing from source code documentation:

    PositionSource.ClosedError - The positioning backend closed the connection, which happens for example in case the user is switching location services to off. As soon as the location service is re-enabled regular updates will resume.



  • @Pablo-J.-Rogina I, If you asking about position updates after location service is turned on: they resume, but QGeoPositionInfoSource::error() still returns QGeoPositionInfoSource::ClosedError as well there is no signal emits with QGeoPositionInfoSource::error(QGeoPositionInfoSource::NoError). This is brobably Qt bug



  • @morte said in detecting status ("on"/"off") of location services:

    This is brobably Qt bug

    I'd call it working as designed, although the design could differ from your expectations :-)

    Seriuosly, I guess you can post a feature request to ask for the error status to be cleared once positioning data resumes.

    For the time being, I guess you need to stop checking for error status once you resume receiving data, or you could even emit a signal of your own once you know data is back again.