Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGeoPositionInfoSource::createDefaultSource(this) Does not fire events ...

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

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 743 Views
  • 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 Offline
    R Offline
    Ritchie
    wrote on last edited by
    #1

    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
    0
    • R Offline
      R Offline
      Ritchie
      wrote on last edited by
      #2

      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
      0

      • Login

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