Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
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 QByteArray;
10 class QGraphicsPixmapItem;
11 class QGraphicsScene;
12 
14 class GraphicsView : public QGraphicsView
15 {
16  Q_OBJECT;
17 
18 public:
20  GraphicsView(QGraphicsScene *scene,
21  MainWindow &mainWindow);
22  virtual ~GraphicsView();
23 
25  void contextMenuEvent (QContextMenuEvent *event);
26 
28  virtual void dragEnterEvent (QDragEnterEvent *event);
29 
31  virtual void dragMoveEvent (QDragMoveEvent *event);
32 
34  virtual void dropEvent (QDropEvent *event);
35 
37  virtual void keyPressEvent (QKeyEvent *event);
38 
40  virtual void leaveEvent (QEvent *event);
41 
43  virtual void mouseMoveEvent (QMouseEvent *event);
44 
46  virtual void mousePressEvent (QMouseEvent *event);
47 
49  virtual void mouseReleaseEvent (QMouseEvent *event);
50 
51 signals:
53  void signalContextMenuEvent (QString pointIdentifier);
54 
56  void signalDraggedDigFile (QString);
57 
59  void signalDraggedImage (QImage);
60 
62  void signalDraggedImageUrl (QUrl);
63 
65  void signalKeyPress (Qt::Key, bool atLeastOneSelectedItem);
66 
68  void signalLeave ();
69 
71  void signalMouseMove (QPointF);
72 
74  void signalMousePress (QPointF);
75 
77  void signalMouseRelease (QPointF);
78 
79 private:
80  GraphicsView();
81 
82  bool inBounds (const QPointF &posScreen);
83  bool loadsAsDigFile (const QString &urlString) const;
84 };
85 
86 #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:14
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 signalDraggedDigFile(QString)
Send dragged dig file to MainWindow for import. This comes from dragging an engauge dig file...
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.