mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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:
parent
f2608edc56
commit
a920d683a1
2 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue