From b533cf299fba1b2d9dd4737f109caf5aba042d7a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 5 Jun 2013 14:44:12 +0900 Subject: 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 --- qt-ui/globe.cpp | 7 +++++++ qt-ui/globe.h | 1 + 2 files changed, 8 insertions(+) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 0bd2db423..97c848d80 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -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() diff --git a/qt-ui/globe.h b/qt-ui/globe.h index 44e50b6ed..41e95735c 100644 --- a/qt-ui/globe.h +++ b/qt-ui/globe.h @@ -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 -- cgit v1.2.3-70-g09d2