From 1a869833d8896b01d04b49a58e08914658e038e9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 13 Jan 2021 13:23:41 +0100 Subject: 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 --- stats/statsview.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'stats/statsview.h') 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 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; }; -- cgit v1.2.3-70-g09d2