summaryrefslogtreecommitdiffstats
path: root/stats/informationbox.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-01-13 15:17:54 +0100
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-01-20 08:47:18 +0100
commit785d5189f617bab7d5dde668563fc4889e46f695 (patch)
tree67a3d41998725d77aadc98c1d57de4a0c7f459d8 /stats/informationbox.h
parentd7878dad36e176ef0e2e1c54db891e115d29b489 (diff)
downloadsubsurface-785d5189f617bab7d5dde668563fc4889e46f695.tar.gz
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>
Diffstat (limited to 'stats/informationbox.h')
-rw-r--r--stats/informationbox.h10
1 files changed, 4 insertions, 6 deletions
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 <vector>
#include <memory>
#include <QFont>
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<QString> &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<std::unique_ptr<QGraphicsSimpleTextItem>> textItems;
};
#endif