statistics: create themes on demand

Create the themes only when needed (singleton pattern). If
the themes should do more than colors, such as for example
fonts, it is not clear whether that can be done before main()
runs. By creating the themes on demand, the Qt UI should
be initialized in the constructors of the themes.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-21 16:17:24 +01:00 committed by Dirk Hohndel
parent 7f1107408d
commit 5f91c69f9c
4 changed files with 21 additions and 10 deletions

View file

@ -54,7 +54,7 @@ public:
QQuickWindow *w() const; // Make window available to items
QSizeF size() const;
QRectF plotArea() const;
void setTheme(int idx); // Invalid indexes will result in the default theme. Chart must be replot for theme to become effective.
void setTheme(bool dark); // Chart must be replot for theme to become effective.
const StatsTheme &getCurrentTheme() const;
void addQSGNode(QSGNode *node, ChartZValue z); // Must only be called in render thread!
void registerChartItem(ChartItem &item);