Important: Please read the Qt Code of Conduct -

Accessing signal of QGeoCoordinate from QML

  • Hello,

    i have a class which reads via QTcpSocket the GPSD socket stream and decodes the json values to QGeoPositionInfo whenever a valid position is available. It then emits the QGeoPositionInfo signal:

    // ---- Content of readyRead()
    // ...
    QGeoPositionInfo pos;
    pos.setCoordinate(QGeoCoordinate(obj["lat"].toDouble(), obj["lon"].toDouble(), obj["alt"].toDouble()));
    emit positionUpdate(pos);

    But i'm a bit clueless how to access QGeoPositionInfo in the QML part:

    Backend {
        id: backend
        onGpsPositionUpdate: {
            gpsPosition.text = pos.coordinate.latitude // <-- Doesn't work

    I appreciate any help, thanks.

    Best regards,

Log in to reply