Pencil2D Animation
Download Community News Docs Contribute

core_lib/src/util/pointerevent.h Source File

  • Main Page
  • Related Pages
  • Classes
  • Files
  •  
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
  • util
pointerevent.h
1#ifndef POINTEREVENT_H
2#define POINTEREVENT_H
3
4#include <QTabletEvent>
5#include <QMouseEvent>
6
7class PointerEvent
8{
9public:
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
60 Qt::KeyboardModifiers modifiers() const;
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#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
77 QInputDevice::DeviceType device() const;
78 QPointingDevice::PointerType pointerType() const;
79#else
80 QTabletEvent::TabletDevice device() const;
81 QTabletEvent::PointerType pointerType() const;
82#endif
83
84private:
85 QTabletEvent* mTabletEvent = nullptr;
86 QMouseEvent* mMouseEvent = nullptr;
87};
88
89#endif // POINTEREVENT_H
PointerEvent
Definition: pointerevent.h:8
PointerEvent::tangentialPressure
qreal tangentialPressure() const
Returns the tangential pressure of a tablet's that support it This is typically given by a finger whe...
Definition: pointerevent.cpp:95
PointerEvent::pos
QPoint pos() const
Returns QPoint of the device.
Definition: pointerevent.cpp:17
PointerEvent::x
int x() const
Returns the x position of the input device in the widget.
Definition: pointerevent.cpp:104
PointerEvent::button
Qt::MouseButton button() const
Returns Qt::MouseButton()
Definition: pointerevent.cpp:45
PointerEvent::isTabletEvent
bool isTabletEvent() const
Returns true if the device was tablet, otherwise false.
Definition: pointerevent.cpp:139
PointerEvent::posF
QPointF posF() const
Returns the QPointF of the device Returns pos() if used on mouse event.
Definition: pointerevent.cpp:31
PointerEvent::y
int y() const
Returns the y position of the input device in the widget.
Definition: pointerevent.cpp:122
PointerEvent::rotation
qreal rotation() const
Returns rotation value if any, otherwise 0.
Definition: pointerevent.cpp:86
PointerEvent::modifiers
Qt::KeyboardModifiers modifiers() const
Returns the modifier created by keyboard while a device was in use.
Definition: pointerevent.cpp:151
PointerEvent::buttons
Qt::MouseButtons buttons() const
Returns Qt::MouseButtons()
Definition: pointerevent.cpp:61
PointerEvent::pressure
qreal pressure() const
Returns a value between 0 and 1 for tablet events, otherwise 1.0.
Definition: pointerevent.cpp:77
QEvent::Type
Type
QMouseEvent
QPoint
QPointF
Qt::KeyboardModifiers
typedef KeyboardModifiers
Qt::MouseButton
MouseButton
QTabletEvent
QTabletEvent::PointerType
PointerType
QTabletEvent::TabletDevice
TabletDevice
Generated on Sat Nov 25 2023 13:00:01 for Pencil2D by doxygen 1.9.6 based on revision 18c5494f61f228a0f7b8820420627d4ac76231a8