subsurface/stats/informationbox.h
Berthold Stoeger 785d5189f6 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>
2021-01-20 08:47:18 +01:00

27 lines
642 B
C++

// SPDX-License-Identifier: GPL-2.0
// A small box displaying statistics information, notably
// for a scatter-plot item or a bar in a bar chart.
#ifndef INFORMATION_BOX_H
#define INFORMATION_BOX_H
#include "chartitem.h"
#include <vector>
#include <memory>
#include <QFont>
struct dive;
class StatsView;
// Information window showing data of highlighted dive
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;
};
#endif