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/statsseries.h | |
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/statsseries.h')
-rw-r--r-- | stats/statsseries.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/stats/statsseries.h b/stats/statsseries.h index cee2ec0a8..bc7cd2c57 100644 --- a/stats/statsseries.h +++ b/stats/statsseries.h @@ -4,11 +4,13 @@ #ifndef STATS_SERIES_H #define STATS_SERIES_H +#include <vector> #include <QPointF> class StatsAxis; class StatsView; struct dive; +class QRectF; class StatsSeries { public: @@ -17,7 +19,11 @@ public: virtual void updatePositions() = 0; // Called if chart geometry changes. virtual bool hover(QPointF pos) = 0; // Called on mouse movement. Return true if an item of this series is highlighted. virtual void unhighlight() = 0; // Unhighlight any highlighted item. - virtual void selectItemsUnderMouse(const QPointF &pos, bool shiftPressed) = 0; + // Returns true if an item was under the mouse. + virtual bool selectItemsUnderMouse(const QPointF &pos, bool shiftPressed) = 0; + virtual bool supportsLassoSelection() const; + // Needs only be defined if supportsLassoSelection() returns true. + virtual void selectItemsInRect(const QRectF &rect, bool shiftPressed, const std::vector<dive *> &oldSelection); virtual void divesSelected(const QVector<dive *> &dives); protected: |