summaryrefslogtreecommitdiffstats
path: root/stats/scatterseries.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-17 22:03:27 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-20 08:47:18 +0100
commitb07a7fe5f10529f7fde0b7d5f614aa311b18dcc7 (patch)
treef7d8b5d62bcadeb20ea09728915cf851863ad5db /stats/scatterseries.h
parent409f159e1d8875f72f50d371860d4aef1975f065 (diff)
downloadsubsurface-b07a7fe5f10529f7fde0b7d5f614aa311b18dcc7.tar.gz
statistics: convert scatter series to use QSG
The original plan to reuse the ChartPixmapItem for the scatteritems was dumped, because it is unclear if the textures are shared if generated for each item. Instead, a new ChartScatterItem was created, where all items share the same textures (one for highlighted, one for non-highlighted). This means that the rendering of the scatter items is now done in the chartitem.cpp file, which feels like a layering violation. Not good, but the easiest for now. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/scatterseries.h')
-rw-r--r--stats/scatterseries.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/stats/scatterseries.h b/stats/scatterseries.h
index a9930b797..b83b6bcad 100644
--- a/stats/scatterseries.h
+++ b/stats/scatterseries.h
@@ -8,10 +8,9 @@
#include <memory>
#include <vector>
-#include <QGraphicsRectItem>
-class QGraphicsPixmapItem;
class QGraphicsScene;
+class ChartScatterItem;
struct InformationBox;
struct StatsVariable;
struct dive;
@@ -34,10 +33,10 @@ private:
std::vector<int> getItemsUnderMouse(const QPointF &f) const;
struct Item {
- std::unique_ptr<QGraphicsPixmapItem> item;
+ std::unique_ptr<ChartScatterItem> item;
dive *d;
double pos, value;
- Item(QGraphicsScene *scene, ScatterSeries *series, dive *d, double pos, double value);
+ Item(StatsView &view, ScatterSeries *series, dive *d, double pos, double value);
void updatePosition(ScatterSeries *series);
void highlight(bool highlight);
};