Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
imagetaskpixmapgraphicsitem.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QEvent>
4 #include <QGraphicsPixmapItem>
5 #include <QFocusEvent>
6 #include <QKeyEvent>
7 #include <QGraphicsSceneHoverEvent>
8 #include <QGraphicsSceneMouseEvent>
9 #include <QGraphicsSceneWheelEvent>
10 #include <QObject>
11 #include <QPixmap>
12 
13 #include "customtabletevent.h"
14 
15 namespace geometrize
16 {
17 
18 namespace scene
19 {
20 
25 class ImageTaskPixmapGraphicsItem : public QObject, public QGraphicsPixmapItem
26 {
27  Q_OBJECT
28 public:
30  explicit ImageTaskPixmapGraphicsItem(const QPixmap& pixmap);
32 
33 signals:
35  void signal_onHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier);
36  void signal_onMousePressEvent(double x, double y, bool ctrlModifier);
37  void signal_onMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier);
38  void signal_onMouseReleaseEvent(double x, double y, bool ctrlModifier);
39  void signal_onWheelEvent(double x, double y, int amount, bool ctrlModifier);
40  void signal_onKeyPressEvent(int key, bool ctrlModifier);
41  void signal_onKeyReleaseEvent(int key, bool ctrlModifier);
42  void signal_onFocusInEvent();
44 
45 protected:
46  bool sceneEvent(QEvent* event) override;
47  void hoverMoveEvent(QGraphicsSceneHoverEvent* event) override;
48  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
49  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
50  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
51  void wheelEvent(QGraphicsSceneWheelEvent* event) override;
52  void keyPressEvent(QKeyEvent* event) override;
53  void keyReleaseEvent(QKeyEvent* event) override;
54  void focusInEvent(QFocusEvent* event) override;
55  void focusOutEvent(QFocusEvent* event) override;
56 };
57 
58 }
59 
60 }
void keyReleaseEvent(QKeyEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:86
void signal_onMousePressEvent(double x, double y, bool ctrlModifier)
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:56
void signal_onWheelEvent(double x, double y, int amount, bool ctrlModifier)
void signal_onKeyReleaseEvent(int key, bool ctrlModifier)
void signal_onCustomTabletEvent(const geometrize::scene::CustomTabletEvent &event)
The CustomTabletEvent class represents a tablet event (specifically from a Wacom Pro pen) that can be...
Definition: customtabletevent.h:87
ImageTaskPixmapGraphicsItem()
Definition: imagetaskpixmapgraphicsitem.cpp:19
The ImageTaskPixmapGraphicsItem class models a pixmap graphic item that goes into the scene for an im...
Definition: imagetaskpixmapgraphicsitem.h:25
void keyPressEvent(QKeyEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:80
void wheelEvent(QGraphicsSceneWheelEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:74
bool sceneEvent(QEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:40
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:50
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:68
void focusOutEvent(QFocusEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:98
void signal_onKeyPressEvent(int key, bool ctrlModifier)
void signal_onMouseReleaseEvent(double x, double y, bool ctrlModifier)
void focusInEvent(QFocusEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:92
void signal_onHoverMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Definition: imagetaskpixmapgraphicsitem.cpp:62
virtual ~ImageTaskPixmapGraphicsItem()
Definition: imagetaskpixmapgraphicsitem.cpp:36
void signal_onMouseMoveEvent(double lastX, double lastY, double x, double y, bool ctrlModifier)