summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlmapwidgethelper.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-17 00:25:19 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit5f2e60142a1c8717a612744ab82f7f8f5c6a3713 (patch)
tree82288fe97e7f6c179bb98b9da4dbed1be5810576 /mobile-widgets/qmlmapwidgethelper.cpp
parent5cc2c02dfbace9e1486e60b8ffe58a136321e500 (diff)
downloadsubsurface-5f2e60142a1c8717a612744ab82f7f8f5c6a3713.tar.gz
mapwidget.qml: add the function centerOnCoordinates()
This function can be called to center the map on a specific coordinates. For the C++ version call it via QMetaObject::invokeMethod() in centerOnDiveSite(). TODO: add QML property animations. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets/qmlmapwidgethelper.cpp')
-rw-r--r--mobile-widgets/qmlmapwidgethelper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmapwidgethelper.cpp b/mobile-widgets/qmlmapwidgethelper.cpp
index d308afa40..2bd27fce8 100644
--- a/mobile-widgets/qmlmapwidgethelper.cpp
+++ b/mobile-widgets/qmlmapwidgethelper.cpp
@@ -15,4 +15,8 @@ void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
qreal longitude = ds->longitude.udeg / 1000000.0;
qreal latitude = ds->latitude.udeg / 1000000.0;
+
+ QMetaObject::invokeMethod(m_map, "centerOnCoordinates",
+ Q_ARG(QVariant, latitude),
+ Q_ARG(QVariant, longitude));
}