aboutsummaryrefslogtreecommitdiffstats
path: root/stats/scatterseries.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'stats/scatterseries.cpp')
-rw-r--r--stats/scatterseries.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/stats/scatterseries.cpp b/stats/scatterseries.cpp
index 03763c118..d5bf69ebb 100644
--- a/stats/scatterseries.cpp
+++ b/stats/scatterseries.cpp
@@ -11,6 +11,7 @@
#include "core/dive.h"
#include "core/divelist.h"
#include "core/qthelper.h"
+#include "core/selection.h"
ScatterSeries::ScatterSeries(StatsView &view, StatsAxis *xAxis, StatsAxis *yAxis,
const StatsVariable &varX, const StatsVariable &varY) :
@@ -72,6 +73,16 @@ std::vector<int> ScatterSeries::getItemsUnderMouse(const QPointF &point) const
return res;
}
+void ScatterSeries::selectItemsUnderMouse(const QPointF &point)
+{
+ std::vector<struct dive *> selected;
+
+ for(int idx: getItemsUnderMouse(point))
+ selected.push_back(items[idx].d);
+
+ setSelection(selected, selected.empty() ? nullptr : selected.front());
+}
+
static QString dataInfo(const StatsVariable &var, const dive *d)
{
// For "numeric" variables, we display value and unit.