Engauge Digitizer 2
Loading...
Searching...
No Matches
GraphicsView.h
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 GRAPHICSVIEW_H
8#define GRAPHICSVIEW_H
9
10#include <QGraphicsView>
11#include <QImage>
12#include <QUrl>
13
14class MainWindow;
15class QByteArray;
16class QGraphicsPixmapItem;
17class QGraphicsScene;
18
20class GraphicsView : public QGraphicsView
21{
22 Q_OBJECT;
23
24public:
26 GraphicsView(QGraphicsScene *scene,
27 MainWindow &mainWindow);
28 virtual ~GraphicsView();
29
31 void contextMenuEvent (QContextMenuEvent *event);
32
34 virtual void dragEnterEvent (QDragEnterEvent *event);
35
37 virtual void dragMoveEvent (QDragMoveEvent *event);
38
40 virtual void dropEvent (QDropEvent *event);
41
43 virtual void keyPressEvent (QKeyEvent *event);
44
46 virtual void leaveEvent (QEvent *event);
47
49 virtual void mouseMoveEvent (QMouseEvent *event);
50
52 virtual void mousePressEvent (QMouseEvent *event);
53
55 virtual void mouseReleaseEvent (QMouseEvent *event);
56
58 virtual void wheelEvent(QWheelEvent *event);
59
60signals:
62 void signalContextMenuEvent (QString pointIdentifier);
63
65 void signalDraggedDigFile (QString);
66
68 void signalDraggedImage (QImage);
69
72
74 void signalKeyPress (Qt::Key, bool atLeastOneSelectedItem);
75
77 void signalLeave ();
78
80 void signalMouseMove (QPointF);
81
83 void signalMousePress (QPointF);
84
86 void signalMouseRelease (QPointF);
87
90
93
94private:
96
97 bool inBounds (const QPointF &posScreen);
98
99};
100
101#endif // GRAPHICSVIEW_H
QGraphicsView class with event handling added. Typically the events are sent to the active digitizing...
virtual void mouseReleaseEvent(QMouseEvent *event)
Intercept mouse release events to move one or more Points.
void signalDraggedImage(QImage)
Send dragged image to MainWindow for import. This typically comes from dragging a file.
virtual void wheelEvent(QWheelEvent *event)
Convert wheel events into zoom in/out.
virtual void dropEvent(QDropEvent *event)
Intercept mouse drop event to support drag-and-drop. This initiates asynchronous loading of the dragg...
void signalKeyPress(Qt::Key, bool atLeastOneSelectedItem)
Send keypress to MainWindow for eventual processing by DigitizeStateAbstractBase subclasses.
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.
void signalContextMenuEvent(QString pointIdentifier)
Send right click on axis point to MainWindow for editing.
virtual void keyPressEvent(QKeyEvent *event)
Intercept key press events to handle left/right/up/down moving.
void signalViewZoomOut()
Send wheel event to MainWindow for zooming out.
void signalLeave()
Send leave to MainWindow for managing the override cursor.
virtual void dragMoveEvent(QDragMoveEvent *event)
Intercept mouse move event to support drag-and-drop.
void signalDraggedDigFile(QString)
Send dragged dig file to MainWindow for import. This comes from dragging an engauge dig file.
virtual void mousePressEvent(QMouseEvent *event)
Intercept mouse press events to create one or more Points.
void signalViewZoomIn()
Send wheel event to MainWindow for zooming in.
virtual void leaveEvent(QEvent *event)
Intercept leave events to manage override cursor.
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 signalDraggedImageUrl(QUrl)
Send dragged url to MainWindow for import. This typically comes from dragging an image from a browser...
void signalMouseMove(QPointF)
Send mouse move to MainWindow for eventual display of cursor coordinates in StatusBar.
void contextMenuEvent(QContextMenuEvent *event)
Intercept right click to support point editing.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition MainWindow.h:78