All Classes Namespaces Functions Variables Enumerations Properties Pages
pointerevent.h
1 #ifndef POINTEREVENT_H
2 #define POINTEREVENT_H
3 
4 #include <QTabletEvent>
5 #include <QMouseEvent>
6 
8 {
9 public:
10  enum InputType {
11  Mouse,
12  Tablet,
13  Touch,
14  Unknown
15  };
16 
17  PointerEvent(QMouseEvent* event);
18  PointerEvent(QTabletEvent* event);
19  ~PointerEvent();
20 
23  QPoint pos() const;
24 
29  QPointF posF() const;
30 
35  qreal pressure() const;
36 
39  qreal rotation() const;
40 
48  qreal tangentialPressure() const;
49 
51  int x() const;
52 
54  int y() const;
55 
57  bool isTabletEvent() const;
58 
61 
63  Qt::MouseButton button() const;
64 
66  Qt::MouseButtons buttons() const;
67 
68  void accept();
69  void ignore();
70 
71  bool isAccepted();
72 
73  QEvent::Type eventType() const;
74  InputType inputType() const;
75 
76  QTabletEvent::TabletDevice device() const;
77  QTabletEvent::PointerType pointerType() const;
78 
79 private:
80  QTabletEvent* mTabletEvent = nullptr;
81  QMouseEvent* mMouseEvent = nullptr;
82 };
83 
84 #endif // POINTEREVENT_H
typedef KeyboardModifiers
Qt::KeyboardModifiers modifiers() const
Returns the modifier created by keyboard while a device was in use.
MouseButton
QPointF posF() const
Returns the QPointF of the device Returns pos() if used on mouse event.
int x() const
Returns the x position of the input device in the widget.
QPoint pos() const
Returns QPoint of the device.
bool isTabletEvent() const
Returns true if the device was tablet, otherwise false.
Qt::MouseButtons buttons() const
Returns Qt::MouseButtons()
qreal pressure() const
Returns a value between 0 and 1 for tablet events, otherwise 1.0.
qreal tangentialPressure() const
Returns the tangential pressure of a tablet's that support it This is typically given by a finger whe...
qreal rotation() const
Returns rotation value if any, otherwise 0.
Qt::MouseButton button() const
Returns Qt::MouseButton()
int y() const
Returns the y position of the input device in the widget.