diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2021-01-13 13:23:41 +0100 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2021-01-20 08:47:18 +0100 |
commit | 1a869833d8896b01d04b49a58e08914658e038e9 (patch) | |
tree | 0fb2db90753afb79d7fdf45c27395107611b25d0 /stats/statsview.h | |
parent | 2b961414d7a52d442f5ecd8c2e42e43d044d0d5e (diff) | |
download | subsurface-1a869833d8896b01d04b49a58e08914658e038e9.tar.gz |
statistics: implement moving of legend
Catch mouse move events and move the legend accordingly.
Currently, this is the only item that can be dragged and
therefore there is no need of doing some kind of fancy
interface. Simply keep a pointer to the legend if it is
dragged.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsview.h')
-rw-r--r-- | stats/statsview.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/stats/statsview.h b/stats/statsview.h index 385a591f4..8270c237f 100644 --- a/stats/statsview.h +++ b/stats/statsview.h @@ -168,10 +168,14 @@ private: std::vector<ChartItem *> items; // Attention: currently, items are not automatically removed on destruction! StatsSeries *highlightedSeries; StatsAxis *xAxis, *yAxis; + Legend *draggedItem; + QPointF dragStartMouse, dragStartItem; void hoverEnterEvent(QHoverEvent *event) override; void hoverMoveEvent(QHoverEvent *event) override; - + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; QSGImageNode *rootNode; }; |