1#include "pointerevent.h"
15PointerEvent::~PointerEvent()
30 else if (mTabletEvent)
32 return mTabletEvent->
posF();
42 return mMouseEvent->
button();
44 else if (mTabletEvent)
46 return mTabletEvent->
button();
60 else if (mTabletEvent)
101 return mMouseEvent->
x();
103 else if (mTabletEvent)
105 return mTabletEvent->
x();
119 return mMouseEvent->
y();
121 else if (mTabletEvent)
123 return mTabletEvent->
y();
150 else if (mTabletEvent)
159void PointerEvent::accept()
165 else if (mTabletEvent)
175void PointerEvent::ignore()
181 else if (mTabletEvent)
191bool PointerEvent::isAccepted()
197 else if (mTabletEvent)
205PointerEvent::Type PointerEvent::eventType()
const
209 switch (mMouseEvent->
type())
216 return Type::Release;
218 return Type::Unmapped;
221 else if (mTabletEvent)
223 switch (mTabletEvent->
type())
230 return Type::Release;
232 return Type::Unmapped;
235 return Type::Unmapped;
238PointerEvent::InputType PointerEvent::inputType()
const
241 return InputType::Mouse;
243 else if (mTabletEvent)
245 return InputType::Tablet;
247 return InputType::Unknown;
250#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
252QInputDevice::DeviceType PointerEvent::device()
const
258 return QInputDevice::DeviceType::Unknown;
261QPointingDevice::PointerType PointerEvent::pointerType()
const
267 return QPointingDevice::PointerType::Unknown;
276 return mTabletEvent->
device();
278 return QTabletEvent::TabletDevice::NoDevice;
287 return QTabletEvent::PointerType::UnknownPointer;
qreal tangentialPressure() const
Returns the tangential pressure of a tablet's that support it This is typically given by a finger whe...
QPointF viewportPos() const
Returns the QPointF of the device, in viewport coordinates Returns pos() if used on mouse event.
int x() const
Returns the x position of the input device in the widget.
Qt::MouseButton button() const
Returns Qt::MouseButton()
bool isTabletEvent() const
Returns true if the device was tablet, otherwise false.
int y() const
Returns the y position of the input device in the widget.
qreal rotation() const
Returns rotation value if any, otherwise 0.
QPointF canvasPos() const
Returns the QPointF of the device, in canvas coordinates.
Qt::KeyboardModifiers modifiers() const
Returns the modifier created by keyboard while a device was in use.
Qt::MouseButtons buttons() const
Returns Qt::MouseButtons()
qreal pressure() const
Returns a value between 0 and 1 for tablet events, otherwise 1.0.
bool isAccepted() const const
QEvent::Type type() const const
const QPointF & localPos() const const
typedef KeyboardModifiers
QTabletEvent::TabletDevice device() const const
QTabletEvent::TabletDevice deviceType() const const
QTabletEvent::PointerType pointerType() const const
const QPointF & posF() const const
qreal pressure() const const
qreal rotation() const const
qreal tangentialPressure() const const