19#include <QGraphicsTextItem>
29 : QGraphicsView(parent)
49 return static_cast<int>((
_scene->itemsBoundingRect()).height());
54 return static_cast<int>((
_scene->itemsBoundingRect()).width());
65 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
66 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
118 QRectF viewRect =
_scene->itemsBoundingRect();
119 _scene->setSceneRect(viewRect);
123 fitInView(sceneInView, Qt::IgnoreAspectRatio);
Definition of the DiagramView class.
A List of data points and all the necessary meta-information to draw a graph.
A scene graph for a 2D Diagram including coordinate axes with labels and ticks for one or more plotte...
void addGraph(DiagramList *list)
Adds a graph to the scene, including all data points and meta-information.
QSize minimumSizeHint() const override
void resizeEvent(QResizeEvent *event) override
Resizes the scene.
int getWidth()
Returns the width of the bounding rectangle of all objects within the scene.
void addGraph(DiagramList *list)
Adds a new graph to the scene.
QSize sizeHint() const override
DiagramView(QWidget *parent=nullptr)
int getHeight()
Returns the height of the bounding rectangle of all objects within the scene.