OGS
DiagramView.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include "DiagramScene.h"
7#include <QGraphicsView>
8#include <QWidget>
9
10
16class DiagramView : public QGraphicsView
17{
18 Q_OBJECT
19public:
23 explicit DiagramView(QWidget* parent = nullptr);
29 explicit DiagramView(DiagramList* list, QWidget* parent = nullptr);
30 ~DiagramView() override;
31
33 void addGraph(DiagramList* list);
35 int getHeight();
37 int getWidth();
38
39protected:
41 void resizeEvent(QResizeEvent* event) override;
42
43private:
44 void initialize();
46 QSize minimumSizeHint() const override;
47 QSize sizeHint() const override;
48 void update();
49
51};
A List of data points and all the necessary meta-information to draw a graph.
Definition DiagramList.h:18
A scene graph for a 2D Diagram including coordinate axes with labels and ticks for one or more plotte...
~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:50
DiagramView(QWidget *parent=nullptr)
int getHeight()
Returns the height of the bounding rectangle of all objects within the scene.