// 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. #ifndef STATSHELPER_H #include #include template T *createItem(QGraphicsScene *scene, Args&&... args) { T *res = new T(std::forward(args)...); scene->addItem(res); return res; } template std::unique_ptr createItemPtr(QGraphicsScene *scene, Args&&... args) { return std::unique_ptr(createItem(scene, std::forward(args)...)); } #endif