Engauge Digitizer  2
GraphicsView.h
1 #ifndef GRAPHICSVIEW_H
2 #define GRAPHICSVIEW_H
3 
4 #include <QGraphicsView>
5 #include <QImage>
6 #include <QUrl>
7 
8 class MainWindow;
9 class QGraphicsPixmapItem;
10 class QGraphicsScene;
11 
13 class GraphicsView : public QGraphicsView
14 {
15  Q_OBJECT;
16 
17 public:
19  GraphicsView(QGraphicsScene *scene,
20  MainWindow &mainWindow);
21  virtual ~GraphicsView();
22 
24  void contextMenuEvent (QContextMenuEvent *event);
25 
27  virtual void dragEnterEvent (QDragEnterEvent *event);
28 
30  virtual void dragMoveEvent (QDragMoveEvent *event);
31 
33  virtual void dropEvent (QDropEvent *event);
34 
36  virtual void keyPressEvent (QKeyEvent *event);
37 
39  virtual void leaveEvent (QEvent *event);
40 
42  virtual void mouseMoveEvent (QMouseEvent *event);
43 
45  virtual void mousePressEvent (QMouseEvent *event);
46 
48  virtual void mouseReleaseEvent (QMouseEvent *event);
49 
50 signals:
52  void signalContextMenuEvent (QString pointIdentifier);
53 
55  void signalDraggedImage (QImage);
56 
58  void signalDraggedImageUrl (QUrl);
59 
61  void signalKeyPress (Qt::Key, bool atLeastOneSelectedItem);
62 
64  void signalLeave ();
65 
67  void signalMouseMove (QPointF);
68 
70  void signalMousePress (QPointF);
71 
73  void signalMouseRelease (QPointF);
74 
75 private:
76  GraphicsView();
77 
78  bool inBounds (const QPointF &posScreen);
79 };
80 
81 #endif // GRAPHICSVIEW_H
void signalMouseMove(QPointF)
Send mouse move to MainWindow for eventual display of cursor coordinates in StatusBar.
virtual void keyPressEvent(QKeyEvent *event)
Intercept key press events to handle left/right/up/down moving.
virtual void dragMoveEvent(QDragMoveEvent *event)
Intercept mouse move event to support drag-and-drop.
virtual void dropEvent(QDropEvent *event)
Intercept mouse drop event to support drag-and-drop. This initiates asynchronous loading of the dragg...
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
Definition: GraphicsView.h:13
void contextMenuEvent(QContextMenuEvent *event)
Intercept right click to support point editing.
virtual void mouseMoveEvent(QMouseEvent *event)
Intercept mouse move events to populate the current cursor position in StatusBar. ...
void signalMousePress(QPointF)
Send mouse press to MainWindow for creating one or more Points.
void signalKeyPress(Qt::Key, bool atLeastOneSelectedItem)
Send keypress to MainWindow for eventual processing by DigitizeStateAbstractBase subclasses.
virtual void mousePressEvent(QMouseEvent *event)
Intercept mouse press events to create one or more Points.
void signalDraggedImage(QImage)
Send dragged image to MainWindow for import. This typically comes from dragging a file...
virtual void leaveEvent(QEvent *event)
Intercept leave events to manage override cursor.
void signalMouseRelease(QPointF)
Send mouse release to MainWindow for moving Points.
virtual void dragEnterEvent(QDragEnterEvent *event)
Intercept mouse drag event to support drag-and-drop.
virtual void mouseReleaseEvent(QMouseEvent *event)
Intercept mouse release events to move one or more Points.
void signalDraggedImageUrl(QUrl)
Send dragged url to MainWindow for import. This typically comes from dragging an image from a browser...
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:60
void signalLeave()
Send leave to MainWindow for managing the override cursor.
void signalContextMenuEvent(QString pointIdentifier)
Send right click on axis point to MainWindow for editing.