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



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



  • Hello all,

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

    Thanks
    R.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.