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. Accessing signal of QGeoCoordinate from QML
Forum Updated to NodeBB v4.3 + New Features

Accessing signal of QGeoCoordinate from QML

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 150 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.
  • K Offline
    K Offline
    kkettinger
    wrote on last edited by
    #1

    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,
    Kevin

    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