Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. detecting status ("on"/"off") of location services
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
locationqtpositioningandroid
4 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    morte
    wrote on 25 Jan 2019, 08:37 last edited by morte
    #1

    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)

    P 1 Reply Last reply 25 Jan 2019, 15:17
    0
    • M morte
      25 Jan 2019, 08:37

      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)

      P Offline
      P Offline
      Pablo J. Rogina
      wrote on 25 Jan 2019, 15:17 last edited by
      #2

      @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.

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      M 1 Reply Last reply 27 Jan 2019, 10:50
      2
      • P Pablo J. Rogina
        25 Jan 2019, 15:17

        @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.

        M Offline
        M Offline
        morte
        wrote on 27 Jan 2019, 10:50 last edited by
        #3

        @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

        P 1 Reply Last reply 28 Jan 2019, 13:42
        0
        • M morte
          27 Jan 2019, 10:50

          @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

          P Offline
          P Offline
          Pablo J. Rogina
          wrote on 28 Jan 2019, 13:42 last edited by
          #4

          @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.

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          1/4

          25 Jan 2019, 08:37

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved