Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved QGeoPositionInfoSource::createDefaultSource(this) Does not fire events ...

    General and Desktop
    1
    2
    620
    Loading More Posts
    • 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.
    • R
      Ritchie last edited by

      Hi,

      I would like to use the "gpsd" damon on a ubuntu 17.04 system. The samples "weatherinfo" and "Satellitinfo" are working with the plugin "libqtposition_gpsd" without any problem.

      But when I use my own program, then it does not fire any event in the defined functions. I placed a break point in the slots, which was never reached.

      defines

      private slots:
              void    positionUpdated(QGeoPositionInfo);
              void    positionError(QGeoPositionInfoSource::Error);
              void    updateTimeout(void);
      

      Program code

      void		SensorThread::positionUpdated(QGeoPositionInfo info)
      {
              m_PositionInfo=info;
      }
      void    SensorThread::positionError(QGeoPositionInfoSource::Error   gpserror)
      {
          qDebug() << gpserror;
      }
      void    SensorThread::updateTimeout(void)
      {
          qDebug() << "Time out";
      }
      
      void SensorThread::run(void)
      {
      ...
          m_ProgramInfo->writelog(tr("carclient"),tr("SensorThread"),tr("Info"),tr("Thread startup"));
      
          qt_Position = QGeoPositionInfoSource::createDefaultSource(this);
      
          if (qt_Position)
              {
              connect(qt_Position, SIGNAL(positionUpdated(QGeoPositionInfo)),this, SLOT(positionUpdated(QGeoPositionInfo)));
              connect(qt_Position, SIGNAL(error(QGeoPositionInfoSource::Error)),this, SLOT(positionError(QGeoPositionInfoSource::Error)));
              connect(qt_Position, SIGNAL(updateTimeout()),this, SLOT(updateTimeout()));
      
              qt_Position->setUpdateInterval(500);
              qt_Position->setPreferredPositioningMethods(QGeoPositionInfoSource::SatellitePositioningMethods);
              qt_Position->startUpdates();
              }
          else
              m_ProgramInfo->writelog(tr("carclient"),tr("SensorThread"),tr("Error"),tr("Could not create qt_Position Object"));
      
      
          qt_Position->requestUpdate();
      
      ...
      }
      

      Here is the output of the program during debug session

      Debugging starts
      &"warning: GDB: Failed to set controlling terminal: Unpassender IOCTL (I/O-Control) f\303\274r das Ger\303\244t\n"
      Connected to gpsd
      Created slave QBuffer(0x7fffd4006100)
      Unpausing slave QBuffer(0x7fffd4006100)
      Starting gpsd
      Debugging has finished
      

      How can I get closed to the problem ?

      Best regards
      R.

      1 Reply Last reply Reply Quote 0
      • R
        Ritchie last edited by

        Hello all,

        I just recode the use of the application instead of C++ to Quick Qt and
        now I get the events.

        Thanks
        R.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post