SILICON
Loading...
Searching...
No Matches
DiagramView Class Reference

#include <diagramView.hpp>

Inheritance diagram for DiagramView:
Collaboration diagram for DiagramView:

Public Slots

void zoomIn ()
 Increases the circuit zoom by one step.
void zoomOut ()
 Decreases the circuit zoom by one step.
void zoomToRect (const QRectF &rect)
 Centers a scene rectangle and fits it within the existing zoom limits.
void centerCircuit ()
 Pans the viewport so the circuit's bounds are centered.
void modeChanged (InteractionMode mode)

Public Member Functions

 DiagramView (QWidget *parent=nullptr)
void setScene (DiagramScene *scene)

Protected Member Functions

void wheelEvent (QWheelEvent *event) override

Private Member Functions

bool zoom (int level)
void updateZoom ()

Private Attributes

int zoomLevel = 100
qreal wheelZoomRemainder = 0

Static Private Attributes

static constexpr int MIN_ZOOM_LEVEL = 60
static constexpr int MAX_ZOOM_LEVEL = 200

Detailed Description

Definition at line 29 of file diagramView.hpp.

Constructor & Destructor Documentation

◆ DiagramView()

DiagramView ( QWidget * parent = nullptr)
explicit

Definition at line 25 of file diagramView.cpp.

Member Function Documentation

◆ centerCircuit

void centerCircuit ( )
slot

Pans the viewport so the circuit's bounds are centered.

Definition at line 127 of file diagramView.cpp.

◆ modeChanged

void modeChanged ( InteractionMode mode)
slot

Definition at line 133 of file diagramView.cpp.

◆ setScene()

void setScene ( DiagramScene * scene)

Definition at line 32 of file diagramView.cpp.

◆ updateZoom()

void updateZoom ( )
private

Definition at line 121 of file diagramView.cpp.

◆ wheelEvent()

void wheelEvent ( QWheelEvent * event)
overrideprotected

Definition at line 47 of file diagramView.cpp.

◆ zoom()

bool zoom ( int level)
private

Definition at line 109 of file diagramView.cpp.

◆ zoomIn

void zoomIn ( )
slot

Increases the circuit zoom by one step.

Definition at line 85 of file diagramView.cpp.

◆ zoomOut

void zoomOut ( )
slot

Decreases the circuit zoom by one step.

Definition at line 90 of file diagramView.cpp.

◆ zoomToRect

void zoomToRect ( const QRectF & rect)
slot

Centers a scene rectangle and fits it within the existing zoom limits.

Parameters
rectRectangle in scene coordinates; QRect converts to QRectF implicitly. Empty rectangles are ignored. The aspect ratio is preserved.

Definition at line 95 of file diagramView.cpp.

Member Data Documentation

◆ MAX_ZOOM_LEVEL

int MAX_ZOOM_LEVEL = 200
staticconstexprprivate

Definition at line 55 of file diagramView.hpp.

◆ MIN_ZOOM_LEVEL

int MIN_ZOOM_LEVEL = 60
staticconstexprprivate

Definition at line 54 of file diagramView.hpp.

◆ wheelZoomRemainder

qreal wheelZoomRemainder = 0
private

Definition at line 57 of file diagramView.hpp.

◆ zoomLevel

int zoomLevel = 100
private

Definition at line 56 of file diagramView.hpp.


The documentation for this class was generated from the following files: