Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
ViewPreview.h
1 #ifndef VIEW_PREVIEW_H
2 #define VIEW_PREVIEW_H
3 
4 #include <QGraphicsView>
5 #include <QPointF>
6 
8 class ViewPreview : public QGraphicsView
9 {
10  Q_OBJECT;
11 
12 public:
13 
16  VIEW_ASPECT_RATIO_VARIABLE,
17  VIEW_ASPECT_RATIO_ONE_TO_ONE
18  };
19 
21  ViewPreview(QGraphicsScene *scene,
22  ViewAspectRatio viewAspectRatio,
23  QWidget *parent = 0);
24 
26  virtual void mouseMoveEvent(QMouseEvent *event);
27 
29  virtual void resizeEvent(QResizeEvent *event);
30 
31 signals:
33  void signalMouseMove (QPointF pos);
34 
35 private:
36  ViewPreview();
37 
38  ViewAspectRatio m_viewAspectRatio;
39 };
40 
41 #endif // VIEW_PREVIEW_H
void signalMouseMove(QPointF pos)
Forward the mouse move events.
ViewAspectRatio
Prevent aspect ratio distortion in certain previews by providing fixed 1:1 aspect ratio option...
Definition: ViewPreview.h:15
virtual void mouseMoveEvent(QMouseEvent *event)
Intercept cursor move events and forward them.
Definition: ViewPreview.cpp:14
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window...
Definition: ViewPreview.h:8
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:21