mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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)
|
MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
m_mapLocationModel = new MapLocationModel(this);
|
m_mapLocationModel = new MapLocationModel(this);
|
||||||
|
connect(m_mapLocationModel, SIGNAL(selectedLocationChanged(MapLocation *)),
|
||||||
|
this, SLOT(selectedLocationChanged(MapLocation *)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
|
void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
|
||||||
|
@ -38,3 +40,8 @@ void MapWidgetHelper::reloadMapLocations()
|
||||||
}
|
}
|
||||||
m_mapLocationModel->addList(locationList);
|
m_mapLocationModel->addList(locationList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapWidgetHelper::selectedLocationChanged(MapLocation *location)
|
||||||
|
{
|
||||||
|
qDebug() << location;
|
||||||
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class MapLocationModel;
|
class MapLocationModel;
|
||||||
|
class MapLocation;
|
||||||
struct dive_site;
|
struct dive_site;
|
||||||
|
|
||||||
class MapWidgetHelper : public QObject {
|
class MapWidgetHelper : public QObject {
|
||||||
|
@ -23,6 +24,9 @@ private:
|
||||||
QObject *m_map;
|
QObject *m_map;
|
||||||
MapLocationModel *m_mapLocationModel;
|
MapLocationModel *m_mapLocationModel;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void selectedLocationChanged(MapLocation *);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void modelChanged();
|
void modelChanged();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue