aboutsummaryrefslogtreecommitdiffstats
path: root/stats/statsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stats/statsview.cpp')
-rw-r--r--stats/statsview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/stats/statsview.cpp b/stats/statsview.cpp
index 61d9db4a6..bf4ecdc6a 100644
--- a/stats/statsview.cpp
+++ b/stats/statsview.cpp
@@ -46,6 +46,7 @@ StatsView::StatsView(QQuickItem *parent) : QQuickItem(parent),
connect(&diveListNotifier, &DiveListNotifier::divesDeleted, this, &StatsView::replotIfVisible);
connect(&diveListNotifier, &DiveListNotifier::dataReset, this, &StatsView::replotIfVisible);
connect(&diveListNotifier, &DiveListNotifier::settingsChanged, this, &StatsView::replotIfVisible);
+ connect(&diveListNotifier, &DiveListNotifier::divesSelected, this, &StatsView::divesSelected);
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
@@ -345,6 +346,15 @@ void StatsView::replotIfVisible()
plot(state);
}
+void StatsView::divesSelected(const QVector<dive *> &dives)
+{
+ if (isVisible()) {
+ for (auto &series: series)
+ series->divesSelected(dives);
+ }
+ update();
+}
+
void StatsView::mouseMoveEvent(QMouseEvent *event)
{
if (!draggedItem)