Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | List of all members
ViewPreview Class Reference

Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window, after resize events. More...

#include <ViewPreview.h>

Inheritance diagram for ViewPreview:

Public Types

enum  ViewAspectRatio { VIEW_ASPECT_RATIO_VARIABLE , VIEW_ASPECT_RATIO_ONE_TO_ONE }
 Prevent aspect ratio distortion in certain previews by providing fixed 1:1 aspect ratio option. More...
 

Signals

void signalMouseMove (QPointF pos)
 Forward the mouse move events.
 

Public Member Functions

 ViewPreview (QGraphicsScene *scene, ViewAspectRatio viewAspectRatio, QWidget *parent=0)
 Single constructor.
 
virtual void mouseMoveEvent (QMouseEvent *event)
 Intercept cursor move events and forward them.
 
virtual void resizeEvent (QResizeEvent *event)
 Intercept resize events so we can rescale to the graphics items just fit into the resized window.
 

Detailed Description

Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window, after resize events.

Definition at line 14 of file ViewPreview.h.

Member Enumeration Documentation

◆ ViewAspectRatio

Prevent aspect ratio distortion in certain previews by providing fixed 1:1 aspect ratio option.

Definition at line 21 of file ViewPreview.h.

Constructor & Destructor Documentation

◆ ViewPreview()

ViewPreview::ViewPreview ( QGraphicsScene *  scene,
ViewAspectRatio  viewAspectRatio,
QWidget *  parent = 0 
)

Single constructor.

Definition at line 11 of file ViewPreview.cpp.

Member Function Documentation

◆ mouseMoveEvent()

void ViewPreview::mouseMoveEvent ( QMouseEvent *  event)
virtual

Intercept cursor move events and forward them.

Definition at line 20 of file ViewPreview.cpp.

◆ resizeEvent()

void ViewPreview::resizeEvent ( QResizeEvent *  event)
virtual

Intercept resize events so we can rescale to the graphics items just fit into the resized window.

Definition at line 27 of file ViewPreview.cpp.


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