Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
PointerEvent Class Reference
+ Collaboration diagram for PointerEvent:
Collaboration graph
[legend]

Public Types

enum  InputType { Mouse , Tablet , Touch , Unknown }
 
enum  Type { Press , Move , Release , Unmapped }
 

Public Member Functions

 PointerEvent (QMouseEvent *event, const QPointF &canvasPos)
 
 PointerEvent (QTabletEvent *event, const QPointF &canvasPos)
 
QPointF canvasPos () const
 Returns the QPointF of the device, in canvas coordinates.
 
QPointF viewportPos () const
 Returns the QPointF of the device, in viewport coordinates Returns pos() if used on mouse event.
 
qreal pressure () const
 Returns a value between 0 and 1 for tablet events, otherwise 1.0.
 
qreal rotation () const
 Returns rotation value if any, otherwise 0.
 
qreal tangentialPressure () const
 Returns the tangential pressure of a tablet's that support it This is typically given by a finger wheel on an airbrush tool.
 
int x () const
 Returns the x position of the input device in the widget.
 
int y () const
 Returns the y position of the input device in the widget.
 
bool isTabletEvent () const
 Returns true if the device was tablet, otherwise false.
 
Qt::KeyboardModifiers modifiers () const
 Returns the modifier created by keyboard while a device was in use.
 
Qt::MouseButton button () const
 Returns Qt::MouseButton()
 
Qt::MouseButtons buttons () const
 Returns Qt::MouseButtons()
 
void accept ()
 
void ignore ()
 
bool isAccepted ()
 
Type eventType () const
 
InputType inputType () const
 
QInputDevice::DeviceType device () const
 
QPointingDevice::PointerType pointerType () const
 

Private Attributes

QTabletEvent * mTabletEvent = nullptr
 
QMouseEvent * mMouseEvent = nullptr
 
QPointF mCanvasPos
 

Detailed Description

Definition at line 7 of file pointerevent.h.

Member Enumeration Documentation

◆ InputType

enum PointerEvent::InputType

Definition at line 10 of file pointerevent.h.

◆ Type

enum PointerEvent::Type

Definition at line 17 of file pointerevent.h.

Constructor & Destructor Documentation

◆ PointerEvent() [1/2]

PointerEvent::PointerEvent ( QMouseEvent *  event,
const QPointF &  canvasPos 
)

Definition at line 3 of file pointerevent.cpp.

◆ PointerEvent() [2/2]

PointerEvent::PointerEvent ( QTabletEvent *  event,
const QPointF &  canvasPos 
)

Definition at line 9 of file pointerevent.cpp.

◆ ~PointerEvent()

PointerEvent::~PointerEvent ( )

Definition at line 15 of file pointerevent.cpp.

Member Function Documentation

◆ accept()

void PointerEvent::accept ( )

Definition at line 159 of file pointerevent.cpp.

◆ button()

Qt::MouseButton PointerEvent::button ( ) const

Returns Qt::MouseButton()

Definition at line 38 of file pointerevent.cpp.

◆ buttons()

Qt::MouseButtons PointerEvent::buttons ( ) const

Returns Qt::MouseButtons()

Definition at line 54 of file pointerevent.cpp.

◆ canvasPos()

QPointF PointerEvent::canvasPos ( ) const

Returns the QPointF of the device, in canvas coordinates.

Definition at line 19 of file pointerevent.cpp.

◆ device()

QInputDevice::DeviceType PointerEvent::device ( ) const

Definition at line 252 of file pointerevent.cpp.

◆ eventType()

PointerEvent::Type PointerEvent::eventType ( ) const

Definition at line 205 of file pointerevent.cpp.

◆ ignore()

void PointerEvent::ignore ( )

Definition at line 175 of file pointerevent.cpp.

◆ inputType()

PointerEvent::InputType PointerEvent::inputType ( ) const

Definition at line 238 of file pointerevent.cpp.

◆ isAccepted()

bool PointerEvent::isAccepted ( )

Definition at line 191 of file pointerevent.cpp.

◆ isTabletEvent()

bool PointerEvent::isTabletEvent ( ) const

Returns true if the device was tablet, otherwise false.

Definition at line 132 of file pointerevent.cpp.

◆ modifiers()

Qt::KeyboardModifiers PointerEvent::modifiers ( ) const

Returns the modifier created by keyboard while a device was in use.

Definition at line 144 of file pointerevent.cpp.

◆ pointerType()

QPointingDevice::PointerType PointerEvent::pointerType ( ) const

Definition at line 261 of file pointerevent.cpp.

◆ pressure()

qreal PointerEvent::pressure ( ) const

Returns a value between 0 and 1 for tablet events, otherwise 1.0.

Definition at line 70 of file pointerevent.cpp.

◆ rotation()

qreal PointerEvent::rotation ( ) const

Returns rotation value if any, otherwise 0.

Definition at line 79 of file pointerevent.cpp.

◆ tangentialPressure()

qreal PointerEvent::tangentialPressure ( ) const

Returns the tangential pressure of a tablet's that support it This is typically given by a finger wheel on an airbrush tool.

The range is from -1.0 to 1.0. 0.0 indicates a neutral position. Current airbrushes can only move in the positive direction from the neutral position. If the device does not support tangential pressure, this value is always 0.0.

Definition at line 88 of file pointerevent.cpp.

◆ viewportPos()

QPointF PointerEvent::viewportPos ( ) const

Returns the QPointF of the device, in viewport coordinates Returns pos() if used on mouse event.

Definition at line 24 of file pointerevent.cpp.

◆ x()

int PointerEvent::x ( ) const

Returns the x position of the input device in the widget.

Definition at line 97 of file pointerevent.cpp.

◆ y()

int PointerEvent::y ( ) const

Returns the y position of the input device in the widget.

Definition at line 115 of file pointerevent.cpp.

Member Data Documentation

◆ mCanvasPos

QPointF PointerEvent::mCanvasPos
private

Definition at line 95 of file pointerevent.h.

◆ mMouseEvent

QMouseEvent* PointerEvent::mMouseEvent = nullptr
private

Definition at line 94 of file pointerevent.h.

◆ mTabletEvent

QTabletEvent* PointerEvent::mTabletEvent = nullptr
private

Definition at line 93 of file pointerevent.h.


The documentation for this class was generated from the following files:
  • core_lib/src/util/pointerevent.h
  • core_lib/src/util/pointerevent.cpp
Generated on Thu May 8 2025 04:47:54 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39