From 785d5189f617bab7d5dde668563fc4889e46f695 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 13 Jan 2021 15:17:54 +0100 Subject: 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 --- stats/informationbox.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'stats/informationbox.h') diff --git a/stats/informationbox.h b/stats/informationbox.h index 741df537f..6ff2bb43e 100644 --- a/stats/informationbox.h +++ b/stats/informationbox.h @@ -4,26 +4,24 @@ #ifndef INFORMATION_BOX_H #define INFORMATION_BOX_H -#include "backend-shared/roundrectitem.h" +#include "chartitem.h" #include #include #include struct dive; -class QGraphicsScene; +class StatsView; // Information window showing data of highlighted dive -struct InformationBox : RoundRectItem { - InformationBox(); +struct InformationBox : ChartRectItem { + InformationBox(StatsView &); void setText(const std::vector &text, QPointF pos); void setPos(QPointF pos); int recommendedMaxLines() const; private: QFont font; // For future specialization. double width, height; - void addLine(const QString &s); - std::vector> textItems; }; #endif -- cgit v1.2.3-70-g09d2