summaryrefslogtreecommitdiffstats
path: root/stats/statsview.cpp
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2021-01-17 13:34:18 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-13 13:02:54 -0800
commit5c098eea29fdb1cd663b78db4e430a1c76c2209a (patch)
treed084244a3dfc20739e78bc4284e0b1075bb82a8e /stats/statsview.cpp
parent1797b59c102eaa5b2091504d96616433aaf0a239 (diff)
downloadsubsurface-5c098eea29fdb1cd663b78db4e430a1c76c2209a.tar.gz
statistics: select dives from Scatter Plot
When clicking on items in a plot, select the corresponding dives. This can be useful for data validation. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsview.cpp')
-rw-r--r--stats/statsview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/stats/statsview.cpp b/stats/statsview.cpp
index 464339a9c..61d9db4a6 100644
--- a/stats/statsview.cpp
+++ b/stats/statsview.cpp
@@ -64,10 +64,11 @@ StatsView::~StatsView()
void StatsView::mousePressEvent(QMouseEvent *event)
{
+ QPointF pos = event->localPos();
+
// Currently, we only support dragging of the legend. If other objects
// should be made draggable, this needs to be generalized.
if (legend) {
- QPointF pos = event->localPos();
QRectF rect = legend->getRect();
if (legend->getRect().contains(pos)) {
dragStartMouse = pos;
@@ -75,8 +76,12 @@ void StatsView::mousePressEvent(QMouseEvent *event)
draggedItem = &*legend;
grabMouse();
setKeepMouseGrab(true); // don't allow Qt to steal the grab
+ return;
}
}
+
+ for (auto &series: series)
+ series->selectItemsUnderMouse(pos);
}
void StatsView::mouseReleaseEvent(QMouseEvent *)