summaryrefslogtreecommitdiffstats
path: root/stats/statsview.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-14 08:48:56 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-20 08:47:18 +0100
commit790d2b2ddb36fd39fe8f002290288603ba1f0065 (patch)
tree95382527bd02bb60be9ebf8c22e577d74b41d8c7 /stats/statsview.h
parentb1c0d424081530161c1637a1a24ff07a4b021097 (diff)
downloadsubsurface-790d2b2ddb36fd39fe8f002290288603ba1f0065.tar.gz
statistics: convert QuartileMarkers to QSGNodes
Slowly converting the QGraphicsScene items to QSGNodes to avoid full replot of the scene. This adds a new abstraction for line-nodes. Since the render() function here is fundamentally different from the pixmap-nodes we had so far, this has to be made virtual. Also, move the quartile markers to their own source file, since the StatsView source file is quite huge already. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statsview.h')
-rw-r--r--stats/statsview.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/stats/statsview.h b/stats/statsview.h
index 1a922ac98..073a200fd 100644
--- a/stats/statsview.h
+++ b/stats/statsview.h
@@ -24,6 +24,7 @@ class CategoryAxis;
class ChartItem;
class CountAxis;
class HistogramAxis;
+class QuartileMarker;
class StatsAxis;
class StatsGrid;
class Legend;
@@ -125,15 +126,6 @@ private:
// Helper functions to add feature to the chart
void addLineMarker(double pos, double low, double high, const QPen &pen, bool isHorizontal);
- // A short line used to mark quartiles
- struct QuartileMarker {
- std::unique_ptr<QGraphicsLineItem> item;
- StatsAxis *xAxis, *yAxis;
- double pos, value;
- QuartileMarker(double pos, double value, QGraphicsScene *scene, StatsAxis *xAxis, StatsAxis *yAxis);
- void updatePosition();
- };
-
// A regression line
struct RegressionLine {
std::unique_ptr<QGraphicsPolygonItem> item;
@@ -163,7 +155,7 @@ private:
std::unique_ptr<StatsGrid> grid;
std::vector<std::unique_ptr<StatsSeries>> series;
std::unique_ptr<Legend> legend;
- std::vector<QuartileMarker> quartileMarkers;
+ std::vector<std::unique_ptr<QuartileMarker>> quartileMarkers;
std::vector<RegressionLine> regressionLines;
std::vector<HistogramMarker> histogramMarkers;
std::unique_ptr<QGraphicsSimpleTextItem> title;