OGS
DiagramView.h
Go to the documentation of this file.
1
15#pragma once
16
17#include "DiagramScene.h"
18#include <QGraphicsView>
19#include <QWidget>
20
21
27class DiagramView : public QGraphicsView
28{
29 Q_OBJECT
30public:
34 explicit DiagramView(QWidget* parent = nullptr);
40 explicit DiagramView(DiagramList* list, QWidget* parent = nullptr);
41 ~DiagramView() override;
42
44 void addGraph(DiagramList* list);
46 int getHeight();
48 int getWidth();
49
50protected:
52 void resizeEvent(QResizeEvent* event) override;
53
54private:
55 void initialize();
57 QSize minimumSizeHint() const override;
58 QSize sizeHint() const override;
59 void update();
60
62};
Definition of the DiagramScene class.
A List of data points and all the necessary meta-information to draw a graph.
Definition DiagramList.h:29
A scene graph for a 2D Diagram including coordinate axes with labels and ticks for one or more plotte...
A view in which to display a DiagramScene.
Definition DiagramView.h:28
~DiagramView() override
QSize minimumSizeHint() const override
void keepItemAspectRatio()
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
void initialize()
DiagramScene * _scene
Definition DiagramView.h:61
DiagramView(QWidget *parent=nullptr)
int getHeight()
Returns the height of the bounding rectangle of all objects within the scene.