Engauge Digitizer 2
|
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window, after resize events. More...
#include <ViewPreview.h>
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. | |
virtual void | wheelEvent (QWheelEvent *event) |
Intercept wheel event and discard it so accidentally moving the wheel does not move drawn items out of view. | |
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.
Prevent aspect ratio distortion in certain previews by providing fixed 1:1 aspect ratio option.
Enumerator | |
---|---|
VIEW_ASPECT_RATIO_VARIABLE | |
VIEW_ASPECT_RATIO_ONE_TO_ONE |
Definition at line 21 of file ViewPreview.h.
ViewPreview::ViewPreview | ( | QGraphicsScene * | scene, |
ViewAspectRatio | viewAspectRatio, | ||
QWidget * | parent = 0 ) |
Single constructor.
Definition at line 12 of file ViewPreview.cpp.
|
virtual |
Intercept cursor move events and forward them.
Definition at line 21 of file ViewPreview.cpp.
|
virtual |
Intercept resize events so we can rescale to the graphics items just fit into the resized window.
Definition at line 34 of file ViewPreview.cpp.
|
virtual |
Intercept wheel event and discard it so accidentally moving the wheel does not move drawn items out of view.
Definition at line 65 of file ViewPreview.cpp.