|
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 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 91 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 106 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 112 of file KoPointerEvent.cpp.
References KisConfigNotifier::instance(), and KisConfigNotifier::notifyTouchPaintingChanged().
| KoPointerEvent::KoPointerEvent | ( | QTouchEvent * | ev, |
| const QPointF & | pnt ) |
Definition at line 122 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | KoPointerEvent * | event, |
| const QPointF & | point ) |
| KoPointerEvent::~KoPointerEvent | ( | ) |
Definition at line 150 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 134 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 442 of file KoPointerEvent.cpp.
References d.
| Qt::MouseButton KoPointerEvent::button | ( | ) | const |
return button pressed (see QMouseEvent::button());
Definition at line 201 of file KoPointerEvent.cpp.
References d.
| Qt::MouseButtons KoPointerEvent::buttons | ( | ) | const |
return buttons pressed (see QMouseEvent::buttons());
Definition at line 218 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 176 of file KoPointerEvent.cpp.
| QPoint KoPointerEvent::globalPos | ( | ) | const |
Return the position screen coordinates.
Definition at line 235 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 453 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::isAccepted | ( | ) | const |
return if the event has been accepted.
Definition at line 464 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::isTabletEvent | ( | ) | const |
Returns if the event comes from a tablet
Definition at line 416 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::isTouchEvent | ( | ) | const |
Returns if the event comes from a touch
Definition at line 421 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 431 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 266 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 306 of file KoPointerEvent.cpp.
References d.
|
inline |
Definition at line 95 of file KoPointerEvent.cpp.
| qreal KoPointerEvent::rotation | ( | ) | const |
return the rotation (or a default value)
Definition at line 327 of file KoPointerEvent.cpp.
References d.
| bool KoPointerEvent::spontaneous | ( | ) | const |
return if this event was spontaneous (see QMouseEvent::spontaneous())
Definition at line 475 of file KoPointerEvent.cpp.
References d.
|
static |
Whether we ever had any tablet inputs this session
Definition at line 426 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 348 of file KoPointerEvent.cpp.
References d.
| ulong KoPointerEvent::time | ( | ) | const |
Returns the time the event was registered.
Definition at line 405 of file KoPointerEvent.cpp.
References d.
| int KoPointerEvent::x | ( | ) | const |
Return the x position in widget coordinates.
Definition at line 296 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 362 of file KoPointerEvent.cpp.
References d.
| int KoPointerEvent::y | ( | ) | const |
Return the y position in widget coordinates.
Definition at line 301 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 377 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 391 of file KoPointerEvent.cpp.
References d.
|
friend |
Definition at line 212 of file KoPointerEvent.h.
|
friend |
Definition at line 211 of file KoPointerEvent.h.
|
friend |
Definition at line 210 of file KoPointerEvent.h.
|
private |
Definition at line 216 of file KoPointerEvent.h.
| boost::variant2::variant<QMouseEvent*, QTabletEvent*, QTouchEvent*> KoPointerEvent::eventPtr |
Definition at line 100 of file KoPointerEvent.cpp.
| QPointF KoPointerEvent::point |
The point in document coordinates.
Definition at line 185 of file KoPointerEvent.h.
|
static |
Definition at line 101 of file KoPointerEvent.cpp.