|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QEvent
com.trolltech.qt.gui.QInputEvent
com.trolltech.qt.gui.QTabletEvent
public class QTabletEvent
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.Notes for X11 Users
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.
Nested Class Summary | |
---|---|
static class |
QTabletEvent.PointerType
This enum defines what type of point is generating the event. |
static class |
QTabletEvent.TabletDevice
This enum defines what type of device is generating the event. |
Nested classes/interfaces inherited from class com.trolltech.qt.core.QEvent |
---|
QEvent.Type |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QTabletEvent(QEvent.Type t,
QPoint pos,
QPoint globalPos,
QPointF hiResGlobalPos,
int device,
int pointerType,
double pressure,
int xTilt,
int yTilt,
double tangentialPressure,
double rotation,
int z,
Qt.KeyboardModifiers keyState,
long uniqueID)
Construct a tablet event of the given type. |
Method Summary | |
---|---|
QTabletEvent.TabletDevice |
device()
Returns the type of device that generated the event. |
QPoint |
globalPos()
Returns the global position of the device at the time of the event. |
int |
globalX()
Returns the global x position of the mouse pointer at the time of the event. |
int |
globalY()
Returns the global y position of the tablet device at the time of the event. |
QPointF |
hiResGlobalPos()
The high precision coordinates delivered from the tablet expressed. |
double |
hiResGlobalX()
The high precision x position of the tablet device. |
double |
hiResGlobalY()
The high precision y position of the tablet device. |
protected QPointF |
mHiResGlobalPos()
|
protected long |
mUnique()
|
QTabletEvent.PointerType |
pointerType()
Returns the type of point that generated the event. |
QPoint |
pos()
Returns the position of the device, relative to the widget that received the event. |
double |
pressure()
Returns the pressure for the device. |
double |
rotation()
Returns the rotation of the current device in degress. |
protected void |
setMHiResGlobalPos(QPointF mHiResGlobalPos)
|
protected void |
setMUnique(long mUnique)
|
double |
tangentialPressure()
Returns the tangential pressure for the device. |
java.lang.String |
toString()
|
long |
uniqueId()
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. |
int |
x()
Returns the x position of the device, relative to the widget that received the event. |
int |
xTilt()
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. |
int |
y()
Returns the y position of the device, relative to the widget that received the event. |
int |
yTilt()
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the y axis. |
int |
z()
Returns the z position of the device. |
Methods inherited from class com.trolltech.qt.gui.QInputEvent |
---|
modifiers, modState, setModState, setModState |
Methods inherited from class com.trolltech.qt.core.QEvent |
---|
accept, ignore, isAccepted, registerEventType, registerEventType, setAccepted, setT, spontaneous, t, type |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QTabletEvent(QEvent.Type t, QPoint pos, QPoint globalPos, QPointF hiResGlobalPos, int device, int pointerType, double pressure, int xTilt, int yTilt, double tangentialPressure, double rotation, int z, Qt.KeyboardModifiers keyState, long uniqueID)
The pos parameter indicates where the event occurred in the widget; globalPos is the corresponding position in absolute coordinates. The hiResGlobalPos contains a high resolution measurement of the position.
pressure contains the pressure exerted on the device.
pointerType describes the type of pen that is being used.
xTilt and yTilt contain the device's degree of tilt from the x and y axes respectively.
keyState specifies which keyboard modifiers are pressed (e.g., Ctrl).
The uniqueID parameter contains the unique ID for the current device.
The z parameter contains the coordinate of the device on the tablet, this is usually given by a wheel on 4D mouse. If the device does not support a Z-axis, pass zero here.
The tangentialPressure paramater contins the tangential pressure of an air brush. If the device does not support tangential pressure, pass 0 here.
rotation contains the device's rotation in degrees. 4D mice support rotation. If the device does not support rotation, pass 0 here.
pos()
, globalPos()
, device()
, pressure()
, xTilt()
, yTilt()
, uniqueId()
, rotation()
, tangentialPressure()
, and z()
.
Method Detail |
---|
public final QTabletEvent.TabletDevice device()
TabletDevice
.
public final QPoint globalPos()
globalPos()
can differ significantly from the current position QCursor::pos()
. globalX()
, globalY()
, and hiResGlobalPos()
.
public final int globalX()
globalY()
, globalPos()
, and hiResGlobalX()
.
public final int globalY()
globalX()
, globalPos()
, and hiResGlobalY()
.
public final QPointF hiResGlobalPos()
QPointF
. globalPos()
, hiResGlobalX()
, and hiResGlobalY()
.
public final double hiResGlobalX()
public final double hiResGlobalY()
public final QTabletEvent.PointerType pointerType()
public final QPoint pos()
If you move widgets around in response to mouse events, use globalPos()
instead of this function.
x()
, y()
, and globalPos()
.
public final double pressure()
tangentialPressure()
.
public final double rotation()
public final double tangentialPressure()
pressure()
.
public final long uniqueId()
Support of this feature is dependent on the tablet.
Values for the same device may vary from OS to OS.
Later versions of the Wacom driver for Linux will now report the ID information. If you have a tablet that supports unique ID and are not getting the information on Linux, consider upgrading your driver.
As of Qt 4.2, the unique ID is the same regardless of the orientation of the pen. Earlier versions would report a different value when using the eraser-end versus the pen-end of the stylus on some OS's.
pointerType()
.
public final int x()
y()
, and pos()
.
public final int xTilt()
yTilt()
.
public final int y()
x()
, and pos()
.
public final int yTilt()
xTilt()
.
public final int z()
pressure()
.
protected final void setMUnique(long mUnique)
protected final long mUnique()
protected final void setMHiResGlobalPos(QPointF mHiResGlobalPos)
protected final QPointF mHiResGlobalPos()
public java.lang.String toString()
toString
in class QInputEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |