libs/flake
KoPointerEvent Class Reference
KoPointerEvent is a synthetic event that can be built from a mouse or a tablet event. More...
#include <KoPointerEvent.h>
Public Member Functions | |
| KoPointerEvent (KoDeviceEvent *ev, int x, int y, int z=0, int rx=0, int ry=0, int rz=0) | |
| KoPointerEvent (QWheelEvent *ev, const QPointF &pnt) | |
| KoPointerEvent (QTabletEvent *ev, const QPointF &pnt) | |
| KoPointerEvent (QMouseEvent *ev, const QPointF &pnt) | |
| ~KoPointerEvent () | |
| void | accept () |
| Qt::MouseButton | button () const |
| Qt::MouseButtons | buttons () const |
| int | delta () const |
| const QPoint & | globalPos () |
| void | ignore () |
| bool | isAccepted () const |
| Qt::KeyboardModifiers | modifiers () const |
| Qt::Orientation | orientation () const |
| const QPoint & | pos () const |
| qreal | pressure () const |
| qreal | rotation () const |
| int | rotationX () const |
| int | rotationY () const |
| int | rotationZ () const |
| bool | spontaneous () const |
| qreal | tangentialPressure () const |
| int | x () const |
| int | xTilt () const |
| int | y () const |
| int | yTilt () const |
| int | z () const |
Public Attributes | |
| const QPointF | point |
Protected Member Functions | |
| void | setTabletButton (Qt::MouseButton button) |
Detailed Description
KoPointerEvent is a synthetic event that can be built from a mouse or a 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 42 of file KoPointerEvent.h.
Constructor & Destructor Documentation
| KoPointerEvent::KoPointerEvent | ( | QMouseEvent * | ev, | |
| const QPointF & | pnt | |||
| ) |
Constructor.
- Parameters:
-
ev the mouse event that is the base of this event. pnt the zoomed point in the normal coordinate system.
Definition at line 45 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | QTabletEvent * | ev, | |
| const QPointF & | pnt | |||
| ) |
Constructor.
- Parameters:
-
ev the tablet event that is the base of this event. pnt the zoomed point in the normal coordinate system.
Definition at line 53 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | QWheelEvent * | ev, | |
| const QPointF & | pnt | |||
| ) |
Constructor.
- Parameters:
-
ev the tablet event that is the base of this event. pnt the zoomed point in the normal coordinate system.
Definition at line 61 of file KoPointerEvent.cpp.
| KoPointerEvent::KoPointerEvent | ( | KoDeviceEvent * | ev, | |
| int | x, | |||
| int | y, | |||
| int | z = 0, |
|||
| int | rx = 0, |
|||
| int | ry = 0, |
|||
| int | rz = 0 | |||
| ) |
Definition at line 69 of file KoPointerEvent.cpp.
| KoPointerEvent::~KoPointerEvent | ( | ) |
Definition at line 80 of file KoPointerEvent.cpp.
Member Function Documentation
| void KoPointerEvent::accept | ( | ) | [inline] |
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 78 of file KoPointerEvent.h.
| Qt::MouseButton KoPointerEvent::button | ( | ) | const |
return button pressed (see QMouseEvent::button());
Definition at line 85 of file KoPointerEvent.cpp.
| Qt::MouseButtons KoPointerEvent::buttons | ( | ) | const |
return buttons pressed (see QMouseEvent::buttons());
Definition at line 97 of file KoPointerEvent.cpp.
| int KoPointerEvent::delta | ( | ) | const |
Returns the distance that the wheel is rotated, in eights of a degree, or 0 otherwise.
- Returns:
- the distance of rotation.
- See also:
- orientation()
Definition at line 208 of file KoPointerEvent.cpp.
| const QPoint & KoPointerEvent::globalPos | ( | ) |
Return the position screen coordinates.
Definition at line 110 of file KoPointerEvent.cpp.
| void KoPointerEvent::ignore | ( | ) | [inline] |
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 87 of file KoPointerEvent.h.
| bool KoPointerEvent::isAccepted | ( | ) | const [inline] |
return if the event has been accepted.
Definition at line 100 of file KoPointerEvent.h.
| Qt::KeyboardModifiers KoPointerEvent::modifiers | ( | ) | const [inline] |
Returns the keyboard modifier flags that existed immediately before the event occurred.
See also QApplication::keyboardModifiers().
Definition at line 95 of file KoPointerEvent.h.
| Qt::Orientation KoPointerEvent::orientation | ( | ) | const |
Returns the orientation of the delta.
Definition at line 231 of file KoPointerEvent.cpp.
| const QPoint & KoPointerEvent::pos | ( | ) | const |
return the position in widget coordinates
Definition at line 122 of file KoPointerEvent.cpp.
| 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 0.5
Definition at line 134 of file KoPointerEvent.cpp.
| qreal KoPointerEvent::rotation | ( | ) | const |
return the rotation (or a default value)
Definition at line 142 of file KoPointerEvent.cpp.
| int KoPointerEvent::rotationX | ( | ) | const |
Returns the rotation around the X-axis.
If the device does not support this, the value is always zero.
Definition at line 216 of file KoPointerEvent.cpp.
| int KoPointerEvent::rotationY | ( | ) | const |
Returns the rotation around the X-axis.
If the device does not support this, the value is always zero.
Definition at line 221 of file KoPointerEvent.cpp.
| int KoPointerEvent::rotationZ | ( | ) | const |
Returns the rotation around the Z-axis.
If the device does not support this, the value is always zero.
Definition at line 226 of file KoPointerEvent.cpp.
| void KoPointerEvent::setTabletButton | ( | Qt::MouseButton | button | ) | [protected] |
called by KoToolProxy to set which button was pressed.
Definition at line 239 of file KoPointerEvent.cpp.
| bool KoPointerEvent::spontaneous | ( | ) | const [inline] |
return if this event was spontaneous (see QMouseEvent::spontaneous())
Definition at line 105 of file KoPointerEvent.h.
| 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 150 of file KoPointerEvent.cpp.
| int KoPointerEvent::x | ( | ) | const |
Return the x position in widget coordinates.
- See also:
- point
Definition at line 158 of file KoPointerEvent.cpp.
| int 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 170 of file KoPointerEvent.cpp.
| int KoPointerEvent::y | ( | ) | const |
Return the y position in widget coordinates.
- See also:
- point
Definition at line 178 of file KoPointerEvent.cpp.
| int 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 190 of file KoPointerEvent.cpp.
| 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 198 of file KoPointerEvent.cpp.
Member Data Documentation
| const QPointF KoPointerEvent::point |
The point in document coordinates.
Definition at line 206 of file KoPointerEvent.h.
The documentation for this class was generated from the following files:
