aboutsummaryrefslogtreecommitdiffstats
path: root/stats/statsseries.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-13 14:56:48 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-20 08:47:18 +0100
commitd7878dad36e176ef0e2e1c54db891e115d29b489 (patch)
treec20493a14d868131b0a373d90ee8927ffd44336a /stats/statsseries.h
parent1a869833d8896b01d04b49a58e08914658e038e9 (diff)
downloadsubsurface-d7878dad36e176ef0e2e1c54db891e115d29b489.tar.gz
statistics: pass view to series
The series were passed a pointer to the QGraphicsScene to add their item. In the future these items will be replaced by QSGNodes. To add these, the series need a reference to the StatsView. Therefore pass it in the constructor. Once everything is replaces by QSGNodes, remove the QGraphicsScene member. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsseries.h')
-rw-r--r--stats/statsseries.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/stats/statsseries.h b/stats/statsseries.h
index 2494569e6..b24be7a79 100644
--- a/stats/statsseries.h
+++ b/stats/statsseries.h
@@ -8,16 +8,18 @@
class QGraphicsScene;
class StatsAxis;
+class StatsView;
class StatsSeries {
public:
- StatsSeries(QGraphicsScene *scene, StatsAxis *xAxis, StatsAxis *yAxis);
+ StatsSeries(QGraphicsScene *scene, StatsView &view, StatsAxis *xAxis, StatsAxis *yAxis);
virtual ~StatsSeries();
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.
protected:
QGraphicsScene *scene;
+ StatsView &view;
StatsAxis *xAxis, *yAxis; // May be zero for charts without axes (pie charts).
QPointF toScreen(QPointF p);
};