diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-19 02:50:07 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | a920d683a196ff28be3e8fa9bbaaab2a67b05553 (patch) | |
tree | 77d00cb209998d6887c47c8b4ae4fbefe8c629d3 /mobile-widgets | |
parent | f2608edc5662f4e2c5afeb83eb395c25bfc4a18a (diff) | |
download | subsurface-a920d683a196ff28be3e8fa9bbaaab2a67b05553.tar.gz |
mapwidgethelper: add a slot to handle marker selection from the model
When MapLocationModel updates the selected marker, MapWidgetHelper now
receives a signal. The slot is named selectedLocationChanged().
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmapwidgethelper.cpp | 7 | ||||
-rw-r--r-- | mobile-widgets/qmlmapwidgethelper.h | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmapwidgethelper.cpp b/mobile-widgets/qmlmapwidgethelper.cpp index 264b62abb..801e46620 100644 --- a/mobile-widgets/qmlmapwidgethelper.cpp +++ b/mobile-widgets/qmlmapwidgethelper.cpp @@ -9,6 +9,8 @@ MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
{
m_mapLocationModel = new MapLocationModel(this);
+ connect(m_mapLocationModel, SIGNAL(selectedLocationChanged(MapLocation *)),
+ this, SLOT(selectedLocationChanged(MapLocation *)));
}
void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
@@ -38,3 +40,8 @@ void MapWidgetHelper::reloadMapLocations() }
m_mapLocationModel->addList(locationList);
}
+
+void MapWidgetHelper::selectedLocationChanged(MapLocation *location)
+{
+ qDebug() << location;
+}
diff --git a/mobile-widgets/qmlmapwidgethelper.h b/mobile-widgets/qmlmapwidgethelper.h index bd575c624..83f9df140 100644 --- a/mobile-widgets/qmlmapwidgethelper.h +++ b/mobile-widgets/qmlmapwidgethelper.h @@ -5,6 +5,7 @@ #include <QObject>
class MapLocationModel;
+class MapLocation;
struct dive_site;
class MapWidgetHelper : public QObject {
@@ -23,6 +24,9 @@ private: QObject *m_map;
MapLocationModel *m_mapLocationModel;
+private slots:
+ void selectedLocationChanged(MapLocation *);
+
signals:
void modelChanged();
};
|