VPTissue Reference Manual
SimShell::Gui::PanAndZoomView Class Reference

QGraphicsView with the ability to pan and zoom. More...

#include <PanAndZoomView.h>

Inheritance diagram for SimShell::Gui::PanAndZoomView:
Inheritance graph
Collaboration diagram for SimShell::Gui::PanAndZoomView:
Collaboration graph

Public Member Functions

 PanAndZoomView (double zoomMin=0.07, double zoomMax=100.0, QWidget *parent=nullptr)
 Constructor. More...
 
virtual ~PanAndZoomView ()
 Destructor.
 
virtual void enterEvent (QEvent *event)
 Overriding enterEvent to grab focus when the view is entered. More...
 
virtual void keyPressEvent (QKeyEvent *event)
 Overriding keyPressEvent to detect when control key is pressed. More...
 
virtual void keyReleaseEvent (QKeyEvent *event)
 Overriding releasePressEvent to detect when control key is released. More...
 
void ResetZoom ()
 Resets the view to the normal zoom level.
 
void ScaleView (double factor)
 Scales the view, bounded by the minimum and maximum zooming factor. More...
 
double Scaling ()
 Gets the current scaling of the view (assuming the view was only scaled with ScaleView() and the horizontal and vertical scaling are the same) More...
 
virtual void wheelEvent (QWheelEvent *event)
 Overriding wheelEvent to scroll the view when control key is held down. More...
 

Detailed Description

QGraphicsView with the ability to pan and zoom.

Definition at line 30 of file PanAndZoomView.h.

Constructor & Destructor Documentation

SimShell::Gui::PanAndZoomView::PanAndZoomView ( double  zoomMin = 0.07,
double  zoomMax = 100.0,
QWidget parent = nullptr 
)

Constructor.

Parameters
zoomMinThe minimum zooming factor
zoomMaxThe maximum zooming factor
parentThe widget's parent

Definition at line 32 of file PanAndZoomView.cpp.

Member Function Documentation

void SimShell::Gui::PanAndZoomView::enterEvent ( QEvent *  event)
virtual

Overriding enterEvent to grab focus when the view is entered.

Parameters
eventThe key event

Definition at line 74 of file PanAndZoomView.cpp.

void SimShell::Gui::PanAndZoomView::keyPressEvent ( QKeyEvent *  event)
virtual

Overriding keyPressEvent to detect when control key is pressed.

Parameters
eventThe key event

Definition at line 57 of file PanAndZoomView.cpp.

void SimShell::Gui::PanAndZoomView::keyReleaseEvent ( QKeyEvent *  event)
virtual

Overriding releasePressEvent to detect when control key is released.

Parameters
eventThe key event

Definition at line 65 of file PanAndZoomView.cpp.

void SimShell::Gui::PanAndZoomView::ScaleView ( double  factor)

Scales the view, bounded by the minimum and maximum zooming factor.

Parameters
factorThe scaling factor

Definition at line 43 of file PanAndZoomView.cpp.

Referenced by wheelEvent().

Here is the caller graph for this function:

double SimShell::Gui::PanAndZoomView::Scaling ( )

Gets the current scaling of the view (assuming the view was only scaled with ScaleView() and the horizontal and vertical scaling are the same)

Parameters
doubleThe scaling factor of the view

Definition at line 87 of file PanAndZoomView.cpp.

Referenced by SimPT_Editor::TissueGraphicsView::GenerateRegularPattern(), and SimPT_Editor::TissueGraphicsView::GenerateVoronoiPattern().

Here is the caller graph for this function:

void SimShell::Gui::PanAndZoomView::wheelEvent ( QWheelEvent *  event)
virtual

Overriding wheelEvent to scroll the view when control key is held down.

Parameters
event

Definition at line 92 of file PanAndZoomView.cpp.

References ScaleView().

Here is the call graph for this function:


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