OGS
|
A view in which to display a DiagramScene.
A view in which to display a DiagramScene. It supports resizing of the window and loading of data into the diagram.
Definition at line 27 of file DiagramView.h.
#include <DiagramView.h>
Public Member Functions | |
DiagramView (QWidget *parent=nullptr) | |
DiagramView (DiagramList *list, QWidget *parent=nullptr) | |
~DiagramView () override | |
void | addGraph (DiagramList *list) |
Adds a new graph to the scene. | |
int | getHeight () |
Returns the height of the bounding rectangle of all objects within the scene. | |
int | getWidth () |
Returns the width of the bounding rectangle of all objects within the scene. | |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *event) override |
Resizes the scene. | |
Private Member Functions | |
void | initialize () |
void | keepItemAspectRatio () |
QSize | minimumSizeHint () const override |
QSize | sizeHint () const override |
void | update () |
Private Attributes | |
DiagramScene * | _scene |
|
explicit |
Creates an empty view.
Definition at line 21 of file DiagramView.cpp.
References _scene, and initialize().
|
explicit |
Creates a view already containing a graph
list | Contains a list of data points and metainformation to be displayed by the scene. |
parent | The parent QWidget. |
Definition at line 28 of file DiagramView.cpp.
References _scene, and initialize().
|
override |
void DiagramView::addGraph | ( | DiagramList * | list | ) |
Adds a new graph to the scene.
Definition at line 41 of file DiagramView.cpp.
References _scene, DiagramScene::addGraph(), and update().
int DiagramView::getHeight | ( | ) |
Returns the height of the bounding rectangle of all objects within the scene.
Definition at line 47 of file DiagramView.cpp.
References _scene.
int DiagramView::getWidth | ( | ) |
Returns the width of the bounding rectangle of all objects within the scene.
Definition at line 52 of file DiagramView.cpp.
References _scene.
|
private |
Initialises the view.
Definition at line 60 of file DiagramView.cpp.
References update().
Referenced by DiagramView(), and DiagramView().
|
private |
|
overrideprivate |
|
overrideprotected |
|
overrideprivate |
Definition at line 97 of file DiagramView.cpp.
References DiagramScene::MARGIN.
|
private |
Updates the view automatically when a new list is added or when the window containing the view is resized or changes its state. Basically, the methods makes sure that everything keeps looking as it is supposed to.
Definition at line 115 of file DiagramView.cpp.
References _scene, and DiagramScene::MARGIN.
Referenced by addGraph(), initialize(), and resizeEvent().
|
private |
Definition at line 61 of file DiagramView.h.
Referenced by DiagramView(), DiagramView(), ~DiagramView(), addGraph(), getHeight(), getWidth(), and update().