![]() |
Home · Overviews · Examples |
The QTabletEvent class contains parameters that describe a Tablet event. More...
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 do subpixeling with higher resolution coordinates or you may 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). It can also give you the minimum and maximum values for each device's pressure and high resolution coordinates.
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 exception are TabletEnterProximity and TabletLeaveProximity events, these are only sent to QApplication and don't check whether or not they are accepted.
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.
Qt uses the following hard-coded names to identify tablet devices from the xorg.conf file on X11 (apart from IRIX): 'stylus', 'pen', and 'eraser'. If the devices have other names, they will not be picked up Qt.
Copyright © 2007 Trolltech | Trademarks | Qt Jambi 4.3.2_01 |