summaryrefslogtreecommitdiffstats
path: root/stats/statshelper.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-18 13:14:38 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-20 08:47:18 +0100
commit9d3de1801e8d14f5143f95042f3b842551d4c4cd (patch)
tree6e53c10b4d54acc5f977262a1ef4fd1dfb72f80f /stats/statshelper.h
parent51f67c6350b7e87051a45fa85aaffb332e3ac517 (diff)
downloadsubsurface-9d3de1801e8d14f5143f95042f3b842551d4c4cd.tar.gz
statistics: remove QSceneGraph
All items are now painted with QSG. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'stats/statshelper.h')
-rw-r--r--stats/statshelper.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/stats/statshelper.h b/stats/statshelper.h
index 29dc083a4..f5d7cbcea 100644
--- a/stats/statshelper.h
+++ b/stats/statshelper.h
@@ -1,29 +1,12 @@
// SPDX-License-Identifier: GPL-2.0
-// Helper functions to render the stats. Currently only
-// contains a small template to create scene-items. This
-// is for historical reasons to ease transition from QtCharts
-// and might be removed.
+// Helper functions to render the stats. Currently contains
+// QSGNode template jugglery to overcome API flaws.
#ifndef STATSHELPER_H
#define STATSHELPER_H
#include <memory>
-#include <QGraphicsScene>
#include <QSGNode>
-template <typename T, class... Args>
-T *createItem(QGraphicsScene *scene, Args&&... args)
-{
- T *res = new T(std::forward<Args>(args)...);
- scene->addItem(res);
- return res;
-}
-
-template <typename T, class... Args>
-std::unique_ptr<T> createItemPtr(QGraphicsScene *scene, Args&&... args)
-{
- return std::unique_ptr<T>(createItem<T>(scene, std::forward<Args>(args)...));
-}
-
// In general, we want chart items to be hideable. For example to show/hide
// labels on demand. Very sadly, the QSG API is absolutely terrible with
// respect to temporarily disabling. Instead of simply having a flag,