diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-02-01 23:17:04 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-02-13 13:02:54 -0800 |
commit | d63d4cd3c357a4294e4810ad320acf519b37882d (patch) | |
tree | 3659929714d26a32cca8b2501a609ef2a6b55be2 /stats/pieseries.cpp | |
parent | e38b78b2aa787e3d1de97fb737601dc30a7fad6b (diff) | |
download | subsurface-d63d4cd3c357a4294e4810ad320acf519b37882d.tar.gz |
statistics: implement rectangle selection in scatter plot
Allow the user to select regions of the scatter plot using
a rectangular selection. When shift is pressed, do an
incremental selection.
Unfortunately, the list-selection code is so slow that this
becomes unusable for a large number of selected dives.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/pieseries.cpp')
-rw-r--r-- | stats/pieseries.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/stats/pieseries.cpp b/stats/pieseries.cpp index 9f55d41d2..61579df74 100644 --- a/stats/pieseries.cpp +++ b/stats/pieseries.cpp @@ -265,12 +265,15 @@ void PieSeries::unhighlight() highlighted = -1; } -void PieSeries::selectItemsUnderMouse(const QPointF &pos, bool) +bool PieSeries::selectItemsUnderMouse(const QPointF &pos, bool) { int index = getItemUnderMouse(pos); - if (index < 0) - return setSelection({}, nullptr); + if (index < 0) { + setSelection({}, nullptr); + return false; + } const std::vector<dive *> &dives = items[index].dives; setSelection(dives, dives.empty() ? nullptr : dives.front()); + return true; } |