Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
View
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
14
class
ViewPreview
:
public
QGraphicsView
15
{
16
Q_OBJECT;
17
18
public
:
19
21
enum
ViewAspectRatio
{
22
VIEW_ASPECT_RATIO_VARIABLE
,
23
VIEW_ASPECT_RATIO_ONE_TO_ONE
24
};
25
27
ViewPreview
(QGraphicsScene *scene,
28
ViewAspectRatio
viewAspectRatio,
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
40
signals:
42
void
signalMouseMove
(QPointF pos);
43
44
private
:
45
ViewPreview
();
46
47
ViewAspectRatio
m_viewAspectRatio;
48
49
};
50
51
#endif
// VIEW_PREVIEW_H
ViewPreview::ViewAspectRatio
ViewAspectRatio
Prevent aspect ratio distortion in certain previews by providing fixed 1:1 aspect ratio option.
Definition
ViewPreview.h:21
ViewPreview::VIEW_ASPECT_RATIO_ONE_TO_ONE
@ VIEW_ASPECT_RATIO_ONE_TO_ONE
Definition
ViewPreview.h:23
ViewPreview::VIEW_ASPECT_RATIO_VARIABLE
@ VIEW_ASPECT_RATIO_VARIABLE
Definition
ViewPreview.h:22
ViewPreview::wheelEvent
virtual void wheelEvent(QWheelEvent *event)
Intercept wheel event and discard it so accidentally moving the wheel does not move drawn items out o...
Definition
ViewPreview.cpp:65
ViewPreview::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Intercept resize events so we can rescale to the graphics items just fit into the resized window.
Definition
ViewPreview.cpp:34
ViewPreview::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
Intercept cursor move events and forward them.
Definition
ViewPreview.cpp:21
ViewPreview::signalMouseMove
void signalMouseMove(QPointF pos)
Forward the mouse move events.
ViewPreview::ViewPreview
ViewPreview(QGraphicsScene *scene, ViewAspectRatio viewAspectRatio, QWidget *parent=0)
Single constructor.
Definition
ViewPreview.cpp:12
Generated on
for Engauge Digitizer by
1.17.0