mapwidgethelper: emit a selectedDivesChanged() signal

The signal emits a QList<int> filled with dive idexes from the
main backend dive table.

The MapWidgetHelper QML instance handles that in onSelectedDivesChanged().
This will only be needed for the mobile version, as the desktop version
should connect it's own slot in MapWidget.cpp.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-07-24 21:41:00 +03:00 committed by Dirk Hohndel
parent e79eac3335
commit c078e350e0
3 changed files with 6 additions and 2 deletions

View file

@ -13,6 +13,10 @@ Item {
MapWidgetHelper {
id: mapHelper
map: map
onSelectedDivesChanged: {
// 'list' contains a list of dive list indexes
console.log("onSelectedDivesChanged: " + list.length);
}
}
Map {

View file

@ -73,8 +73,7 @@ void MapWidgetHelper::selectedLocationChanged(MapLocation *location)
if (locationCoord.distanceTo(dsCoord) < m_smallCircleRadius)
m_selectedDiveIds.append(idx);
}
qDebug() << "selectedDiveIds:" << m_selectedDiveIds;
emit selectedDivesChanged(m_selectedDiveIds);
}
/*

View file

@ -34,6 +34,7 @@ private slots:
signals:
void modelChanged();
void selectedDivesChanged(QList<int> list);
};
extern "C" const char *printGPSCoords(int lat, int lon);