|
Krita Source Code Documentation
|
#include <KoPointerEvent.h>
Inheritance diagram for KoPointerEvent:Public Member Functions | |
| void | accept () |
| Qt::MouseButton | button () const |
| return button pressed (see QMouseEvent::button()); | |
| Qt::MouseButtons | buttons () const |
| return buttons pressed (see QMouseEvent::buttons()); | |
| KoPointerEventWrapper | deepCopyEvent () const |
| QPoint | globalPos () const |
| Return the position screen coordinates. | |
| void | ignore () |
| bool | isAccepted () const |
| return if the event has been accepted. | |
| bool | isTabletEvent () const |
| bool | isTouchEvent () const |
| KoPointerEvent (const KoPointerEvent &rhs) | |
| KoPointerEvent (KoPointerEvent *event, const QPointF &point) | |
| KoPointerEvent (QMouseEvent *event, const QPointF &point) | |
| KoPointerEvent (QTabletEvent *event, const QPointF &point) | |
| KoPointerEvent (QTouchEvent *ev, const QPointF &pnt) | |
| Qt::KeyboardModifiers | modifiers () const |
| KoPointerEvent & | operator= (const KoPointerEvent &rhs) |
| QPoint | pos () const |
| return the position in widget coordinates | |
| qreal | pressure () const |
| template<typename Event > | |
| Private (Event *event) | |
| qreal | rotation () const |
| return the rotation (or a default value) | |
| bool | spontaneous () const |
| return if this event was spontaneous (see QMouseEvent::spontaneous()) | |
| qreal | tangentialPressure () const |
| ulong | time () const |
| int | x () const |
| qreal | xTilt () const |
| int | y () const |
| qreal | yTilt () const |
| int | z () const |
| ~KoPointerEvent () | |
Static Public Member Functions | |
| static std::optional< QPointF > | fetchGlobalPositionFromPointerEvent (QEvent *event) |
| static bool | tabletInputReceived () |
Public Attributes | |
| boost::variant2::variant< QMouseEvent *, QTabletEvent *, QTouchEvent * > | eventPtr |
| QPointF | point |
| The point in document coordinates. | |
Static Public Attributes | |
| static bool | s_tabletInputReceived |
Private Attributes | |
| const QScopedPointer< Private > | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Friends | |
| class | KisScratchPadEventFilter |
| class | KisToolProxy |
| class | KoToolProxy |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
KoPointerEvent is a synthetic event that can be built from a mouse, touch or tablet event. In addition to always providing tools with tablet pressure characteristics, KoPointerEvent has both the original (canvas based) position as well as the normalized position, that is, the position of the event in the document coordinates.
Definition at line 92 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | QMouseEvent * | event, |
| const QPointF & | point ) |
Constructor.
| event | the mouse event that is the base of this event. |
| point | the zoomed point in the normal coordinate system. |
Definition at line 107 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | QTabletEvent * | event, |
| const QPointF & | point ) |
Constructor.
| event | the tablet event that is the base of this event. |
| point | the zoomed point in the normal coordinate system. |
Definition at line 113 of file KoPointerEvent.cpp.
References KisConfigNotifier::instance(), and KisConfigNotifier::notifyTouchPaintingChanged().
| KoPointerEvent::KoPointerEvent | ( | QTouchEvent * | ev, |
| const QPointF & | pnt ) |
Definition at line 123 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | KoPointerEvent * | event, |
| const QPointF & | point ) |
| KoPointerEvent::~KoPointerEvent | ( | ) |
Definition at line 151 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | const KoPointerEvent & | rhs | ) |
Copies the event object
The newly created object will still point to the original QMouseEvent, QTabletEvent or QTouchEvent, so it is not safe to store such object. If you want to store a KoPointerEvent object, use deepCopyEvent() instead.
Definition at line 135 of file KoPointerEvent.cpp.
| void KoPointerEvent::accept | ( | ) |
For classes that are handed this event, you can choose to accept (default) this event. Acceptance signifies that you have handled this event and found it useful, the effect of that will be that the event will not be handled to other event handlers.
Definition at line 443 of file KoPointerEvent.cpp.
References d.
| Qt::MouseButton KoPointerEvent::button | ( | ) | const |
return button pressed (see QMouseEvent::button());
Definition at line 202 of file KoPointerEvent.cpp.
References d.
| Qt::MouseButtons KoPointerEvent::buttons | ( | ) | const |
return buttons pressed (see QMouseEvent::buttons());
Definition at line 219 of file KoPointerEvent.cpp.
References d.
| KoPointerEventWrapper KoPointerEvent::deepCopyEvent | ( | ) | const |
Copies KoPointerEvent and its underlying Qt event.
Normal copy-constructor keeps the pointers to the original Qt event intact, therefore you cannot store this event for any time longer than the lifetime of the handler for this event.
Definition at line 177 of file KoPointerEvent.cpp.
|
static |
Definition at line 504 of file KoPointerEvent.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE.
| QPoint KoPointerEvent::globalPos | ( | ) | const |
Return the position screen coordinates.
Definition at line 236 of file KoPointerEvent.cpp.
| void KoPointerEvent::ignore | ( | ) |
For classes that are handed this event, you can choose to ignore this event. Ignoring this event means you have not handled it and want to allow other event handlers to try to handle it.
Definition at line 454 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::isAccepted | ( | ) | const |
return if the event has been accepted.
Definition at line 465 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::isTabletEvent | ( | ) | const |
Returns if the event comes from a tablet
Definition at line 417 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::isTouchEvent | ( | ) | const |
Returns if the event comes from a touch
Definition at line 422 of file KoPointerEvent.cpp.
References d.
| Qt::KeyboardModifiers KoPointerEvent::modifiers | ( | ) | const |
Returns the keyboard modifier flags that existed immediately before the event occurred. See also QApplication::keyboardModifiers().
Definition at line 432 of file KoPointerEvent.cpp.
References d.
| KoPointerEvent & KoPointerEvent::operator= | ( | const KoPointerEvent & | rhs | ) |
| QPoint KoPointerEvent::pos | ( | ) | const |
return the position in widget coordinates
Definition at line 267 of file KoPointerEvent.cpp.
References d.
| qreal KoPointerEvent::pressure | ( | ) | const |
return the pressure (or a default value). The range is 0.0 - 1.0 and the default pressure (this is the pressure that will be given when you use something like the mouse) is 1.0
Definition at line 307 of file KoPointerEvent.cpp.
References d.
|
inline |
Definition at line 96 of file KoPointerEvent.cpp.
| qreal KoPointerEvent::rotation | ( | ) | const |
return the rotation (or a default value)
Definition at line 328 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::spontaneous | ( | ) | const |
return if this event was spontaneous (see QMouseEvent::spontaneous())
Definition at line 476 of file KoPointerEvent.cpp.
References d.
|
static |
Whether we ever had any tablet inputs this session
Definition at line 427 of file KoPointerEvent.cpp.
| qreal KoPointerEvent::tangentialPressure | ( | ) | const |
return the tangential pressure (or a default value) 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 349 of file KoPointerEvent.cpp.
References d.
| ulong KoPointerEvent::time | ( | ) | const |
Returns the time the event was registered.
Definition at line 406 of file KoPointerEvent.cpp.
References d.
| int KoPointerEvent::x | ( | ) | const |
Return the x position in widget coordinates.
Definition at line 297 of file KoPointerEvent.cpp.
References pos().
| qreal KoPointerEvent::xTilt | ( | ) | const |
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. Positive values are towards the tablet's physical right. The angle is in the range -60 to +60 degrees. The default value is 0.
Definition at line 363 of file KoPointerEvent.cpp.
References d.
| int KoPointerEvent::y | ( | ) | const |
Return the y position in widget coordinates.
Definition at line 302 of file KoPointerEvent.cpp.
References pos().
| qreal KoPointerEvent::yTilt | ( | ) | const |
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. Positive values are towards the tablet's physical right. The angle is in the range -60 to +60 degrees. The default value is 0.
Definition at line 378 of file KoPointerEvent.cpp.
References d.
| int KoPointerEvent::z | ( | ) | const |
Returns the z position of the device. Typically this is represented by a wheel on a 4D Mouse. If the device does not support a Z-axis, this value is always zero. This is not the same as pressure.
Definition at line 392 of file KoPointerEvent.cpp.
References d.
|
friend |
Definition at line 215 of file KoPointerEvent.h.
|
friend |
Definition at line 214 of file KoPointerEvent.h.
|
friend |
Definition at line 213 of file KoPointerEvent.h.
|
private |
Definition at line 219 of file KoPointerEvent.h.
| boost::variant2::variant<QMouseEvent*, QTabletEvent*, QTouchEvent*> KoPointerEvent::eventPtr |
Definition at line 101 of file KoPointerEvent.cpp.
| QPointF KoPointerEvent::point |
The point in document coordinates.
Definition at line 186 of file KoPointerEvent.h.
|
static |
Definition at line 102 of file KoPointerEvent.cpp.