Engauge Digitizer 2
Loading...
Searching...
No Matches
ViewPreview.h
Go to the documentation of this file.
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#ifndef VIEW_PREVIEW_H
8#define VIEW_PREVIEW_H
9
10#include <QGraphicsView>
11#include <QPointF>
12
14class ViewPreview : public QGraphicsView
15{
17
18public:
19
25
27 ViewPreview(QGraphicsScene *scene,
29 QWidget *parent = 0);
30
32 virtual void mouseMoveEvent(QMouseEvent *event);
33
35 virtual void resizeEvent(QResizeEvent *event);
36
38 virtual void wheelEvent (QWheelEvent *event);
39
43
44private:
46
47 ViewAspectRatio m_viewAspectRatio;
48
49};
50
51#endif // VIEW_PREVIEW_H
const int INNER_RADIUS_MIN
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window,...
Definition ViewPreview.h:15
ViewAspectRatio
Prevent aspect ratio distortion in certain previews by providing fixed 1:1 aspect ratio option.
Definition ViewPreview.h:21
@ VIEW_ASPECT_RATIO_ONE_TO_ONE
Definition ViewPreview.h:23
@ VIEW_ASPECT_RATIO_VARIABLE
Definition ViewPreview.h:22
virtual void wheelEvent(QWheelEvent *event)
Intercept wheel event and discard it so accidentally moving the wheel does not move drawn items out o...
virtual void resizeEvent(QResizeEvent *event)
Intercept resize events so we can rescale to the graphics items just fit into the resized window.
virtual void mouseMoveEvent(QMouseEvent *event)
Intercept cursor move events and forward them.
void signalMouseMove(QPointF pos)
Forward the mouse move events.