Dear all, I am making an application which must show the location of a ship. The actual location comes from outside the application which I am making. To show the location, I want to make use of the LocationDisplay class. So I started a default ArcGIS application in Qt Creator (I tried both a QML and C++ app), and made a class, which is derived from QGeoPositionInfoSource, according to this example(https://github.com/Esri/dynamic-situational-awareness-qt/blob/master/Shared/GPXLocationSimulator.h), linked by LDanzinger-esristaff, also on this forum. However, I just can't seem to get it to work. It seems I just don't understand it, and to be hones I'm getting a bit frustrated 
My code is as follows:
The header:
#ifndef SHIPPOSITIONSOURCE_H
#define SHIPPOSITIONSOURCE_H
#include <QGeoPositionInfoSource>
class ShipPositionSource : public QGeoPositionInfoSource
{
Q_OBJECT
public:
explicit ShipPositionSource(QObject* parent = nullptr);
~ShipPositionSource();
QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
PositioningMethods supportedPositioningMethods() const override;
int minimumUpdateInterval() const override;
QGeoPositionInfoSource::Error error() const override;
public slots:
void startUpdates() override;
void stopUpdates() override;
void requestUpdate(int timeout = 0) override;
private:
QGeoPositionInfo currentPosition;
QGeoPositionInfoSource::Error lastError = QGeoPositionInfoSource::NoError;
bool started;
};
#endif // SHIPPOSITIONSOURCE_H
The source:
#include "shippositionsource.h"
ShipPositionSource::ShipPositionSource(QObject* parent) :
QGeoPositionInfoSource(parent)
{
setUpdateInterval(500);
currentPosition.setCoordinate(QGeoCoordinate(52.920905, 4.862173));
emit positionUpdated(currentPosition);
}
ShipPositionSource::~ShipPositionSource()
{}
void ShipPositionSource::startUpdates()
{
if(started)
return;
started = true;
//TODO: start communication with bridge
}
void ShipPositionSource::stopUpdates()
{
if(!started)
return;
started = false;
//TODO: stop communication with bridge
}
void ShipPositionSource::requestUpdate(int timeout)
{
Q_UNIMPLEMENTED();
}
QGeoPositionInfo ShipPositionSource::lastKnownPosition(bool fromSatellitePositioningMethodsOnly) const
{
Q_UNUSED(fromSatellitePositioningMethodsOnly);
return currentPosition;
}
QGeoPositionInfoSource::PositioningMethods ShipPositionSource::supportedPositioningMethods() const
{
return QGeoPositionInfoSource::PositioningMethod::NoPositioningMethods;
}
int ShipPositionSource::minimumUpdateInterval() const
{
return updateInterval();
}
QGeoPositionInfoSource::Error ShipPositionSource::error() const
{
return lastError;
}
I made a Quick C++ app, called TestProject, and in TestProject.cpp I only edited the TestProject::setMapView method with the following lines:
m_mapView = mapView;
m_mapView->locationDisplay()->setPositionSource(&positionSource);
m_mapView->locationDisplay()->setAutoPanMode(LocationDisplayAutoPanMode::Recenter);
m_mapView->locationDisplay()->start();
m_mapView->setMap(m_map);
The result is that I don't see any location updated, or the map centering on the position I gave in the constructor. I must be doing something wrong or I don't understand something, but I don't see what. I would be very thankful for hints and tips!