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>
This commit is contained in:
Lubomir I. Ivanov 2017-07-19 02:50:07 +03:00 committed by Dirk Hohndel
parent f2608edc56
commit a920d683a1
2 changed files with 11 additions and 0 deletions

View file

@ -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;
}

View file

@ -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();
};