Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QTabletEvent class contains parameters that describe a Tablet event. More...
#include <QTabletEvent>
Inherits QInputEvent.
The QTabletEvent class contains parameters that describe a Tablet event.
Tablet Events are generated from a Wacom tablet. Most of the time you will want to deal with events from the tablet as if they were events from a mouse; for example, you would retrieve the cursor position with x(), y(), pos(), globalX(), globalY(), and globalPos(). In some situations you may wish to retrieve the extra information provided by the tablet device driver; for example, you might want to adjust color brightness based on pressure. QTabletEvent allows you to read the pressure(), the xTilt(), and yTilt(), as well as the type of device being used with device() (see TabletDevice).
A tablet event contains a special accept flag that indicates whether the receiver wants the event. You should call QTabletEvent::accept() if you handle the tablet event; otherwise it will be sent to the parent widget.
The QWidget::setEnabled() function can be used to enable or disable mouse and keyboard events for a widget.
The event handler QWidget::tabletEvent() receives all three types of tablet events. Qt will first send a tabletEvent then, if it is not accepted, it will send a mouse event. This allows applications that don't utilize tablets to use a tablet like a mouse, while also enabling those who want to use both tablets and mouses differently.
This enum defines what type of device is generating the event.
QTabletEvent::NoDevice | No device, or an unknown device. |
QTabletEvent::Puck | A Puck (a device that is similar to a flat mouse with a transparent circle with cross-hairs). |
QTabletEvent::Stylus | A Stylus (the narrow end of the pen). |
QTabletEvent::Eraser | An Eraser (the broad end of the pen). |
Returns the type of device that generated the event.
This is useful if you want to know which end of a pen was used to draw on the tablet.
See also TabletDevice.
Returns the global position of the device at the time of the event. This is important on asynchronous windows systems like X11; whenever you move your widgets around in response to mouse events, globalPos() can differ significantly from the current position QCursor::pos().
See also globalX() and globalY().
Returns the global x position of the mouse pointer at the time of the event.
See also globalY() and globalPos().
Returns the global y position of the mouse pointer at the time of the event.
See also globalX() and globalPos().
Returns the position of the device, relative to the widget that received the event.
If you move widgets around in response to mouse events, use globalPos() instead of this function.
See also x(), y(), and globalPos().
Returns the pressure that is exerted on the device. This number is a value from 0 (no pressure) to 255 (maximum pressure) inclusive. The pressure is always scaled to be within this range no matter how many pressure levels the underlying hardware supports.
Returns a unique ID for the current device, making it possible to differentiate between multiple devices being used at the same time on the tablet.
Values for the same device might vary from OS to OS.
It is possible to generate a unique ID for any Wacom device.
Returns the x position of the device, relative to the widget that received the event.
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.
See also yTilt().
Returns the y position of the device, relative to the widget that received the event.
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the y axis. Positive values are towards the bottom of the tablet. The angle is within the range -60 to +60 degrees.
See also xTilt().
Copyright © 2004 Trolltech | Trademarks | Qt 4.0.0-b1 |