statistics: turn infobox into a QSGNode

A small step in converting from QGraphicsScene to QQuickItem.
This is the second item to be converted (after the legend)
and for now items are drawn in order of creation, which means
that the infobox is on top of the legend. This will have
to be made deterministic in follow-up commits.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-01-13 15:17:54 +01:00 committed by bstoeger
parent d7878dad36
commit 785d5189f6
8 changed files with 53 additions and 58 deletions

View file

@ -4,6 +4,7 @@
#include "statscolors.h"
#include "statshelper.h"
#include "statstranslations.h"
#include "statsview.h"
#include "zvalues.h"
#include <numeric>
@ -246,7 +247,7 @@ bool PieSeries::hover(QPointF pos)
if (highlighted >= 0 && highlighted < (int)items.size()) {
items[highlighted].highlight(highlighted, true, (int)items.size());
if (!information)
information = createItemPtr<InformationBox>(scene);
information = view.createChartItem<InformationBox>();
information->setText(makeInfo(highlighted), pos);
} else {
information.reset();