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. Geolocation services in IOS are not generating signal ???

Geolocation services in IOS are not generating signal ???

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 828 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.
  • E Offline
    E Offline
    eduneb
    wrote on last edited by
    #1

    Hi

    I am trying this code in IOS, iphone 5 and I get the message Source Created but it appears that the signal for teh slot ( positionUpdate) is never generated: I do not get the the debuging comment "Position updated:" inside the slot.

    Is there anything else I need to do to get the location services working in IOS8

    Thank you

    class Location : public QObject
    {
    Q_OBJECT
    public:
    Location(QObject *parent = 0)
    : QObject(parent)
    {

          qDebug() << "Position created:";
         QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
    
         if (source) {
            
             connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
                     this, SLOT(positionUpdated(QGeoPositionInfo)));
    
              qDebug() << "Source created:";
    
             source->setUpdateInterval(1000);
             source->startUpdates();
         }
     }
    

    private slots:
    void positionUpdated(const QGeoPositionInfo &info)
    {

         qDebug() << "Position updated:" << info;
     
    
     }
    

    };

    1 Reply Last reply
    0
    • E Offline
      E Offline
      eduneb
      wrote on last edited by
      #2

      Hi

      a clear view of the code in previous msg

      @class Location : public QObject
      {
      Q_OBJECT
      public:
      Location(QObject *parent = 0)
      : QObject(parent)
      {

            qDebug() << "Position created:";
        
      
           if (source) {
               source->setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);
               connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
                       this, SLOT(positionUpdated(QGeoPositionInfo)));
                qDebug() << "Source created:";
               source->setUpdateInterval(1000);
               source->startUpdates();
      
           }
       }
      

      private slots:
      void positionUpdated(const QGeoPositionInfo &info)
      {

           qDebug() << "Position updated:" << info;
         
       }
      

      };
      @

      1 Reply Last reply
      0

      • Login

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