Get single click on the map widget in a callback for further processing

Now Linus can write the code that selects the right dives...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-06-05 14:44:12 +09:00
parent 6f979b48ed
commit b533cf299f
2 changed files with 8 additions and 0 deletions

View file

@ -54,6 +54,13 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0)
setShowOverviewMap(false);
setShowScaleBar(true);
setShowCompass(false);
connect(this, SIGNAL(mouseClickGeoPosition(qreal, qreal, GeoDataCoordinates::Unit)), this, SLOT(mouseClicked(qreal, qreal, GeoDataCoordinates::Unit)));
}
void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
{
GeoDataCoordinates here(lon, lat, unit);
qDebug("At this point Linus will make magic appear... %f/%f", here.longitude(GeoDataCoordinates::Degree), here.latitude(GeoDataCoordinates::Degree));
}
void GlobeGPS::reload()

View file

@ -31,6 +31,7 @@ private:
public Q_SLOTS:
void changeDiveGeoPosition(qreal lon,qreal lat,GeoDataCoordinates::Unit);
void mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit);
};
#endif