1QTabletEvent(3qt) QTabletEvent(3qt)
2
3
4
6 QTabletEvent - Parameters that describe a Tablet event
7
9 #include <qevent.h>
10
11 Inherits QEvent.
12
13 Public Members
14 enum TabletDevice { NoDevice = -1, Puck, Stylus, Eraser }
15 QTabletEvent ( Type t, const QPoint & pos, const QPoint & globalPos,
16 int device, int pressure, int xTilt, int yTilt, const QPair<int,
17 int> & uId )
18 QTabletEvent ( const QPoint & pos, const QPoint & globalPos, int
19 device, int pressure, int xTilt, int yTilt, const QPair<int, int> &
20 uId ) (obsolete)
21 int pressure () const
22 int xTilt () const
23 int yTilt () const
24 const QPoint & pos () const
25 const QPoint & globalPos () const
26 int x () const
27 int y () const
28 int globalX () const
29 int globalY () const
30 TabletDevice device () const
31 int isAccepted () const
32 void accept ()
33 void ignore ()
34 QPair<int, int> uniqueId ()
35
37 The QTabletEvent class contains parameters that describe a Tablet
38 event.
39
40 Tablet Events are generated from a Wacom© tablet. Most of the time
41 you will want to deal with events from the tablet as if they were
42 events from a mouse, for example retrieving the position with x(), y(),
43 pos(), globalX(), globalY() and globalPos(). In some situations you may
44 wish to retrieve the extra information provided by the tablet device
45 driver, for example, you might want to adjust color brightness based on
46 pressure. QTabletEvent allows you to get the pressure(), the xTilt()
47 and yTilt(), as well as the type of device being used with device()
48 (see TabletDevice).
49
50 A tablet event contains a special accept flag that indicates whether
51 the receiver wants the event. You should call QTabletEvent::accept() if
52 you handle the tablet event; otherwise it will be sent to the parent
53 widget.
54
55 The QWidget::setEnabled() function can be used to enable or disable
56 mouse and keyboard events for a widget.
57
58 The event handler QWidget::tabletEvent() receives all three types of
59 tablet events. Qt will first send a tabletEvent and then, if it is not
60 accepted, it will send a mouse event. This allows applications that
61 don't utilize tablets to use a tablet like a mouse while also enabling
62 those who want to use both tablets and mouses differently.
63
64 See also Event Classes.
65
66 Member Type Documentation
68 This enum defines what type of device is generating the event.
69
70 QTabletEvent::NoDevice - No device, or an unknown device.
71
72 QTabletEvent::Puck - A Puck (a device that is similar to a flat mouse
73 with a transparent circle with cross-hairs).
74
75 QTabletEvent::Stylus - A Stylus (the narrow end of the pen).
76
77 QTabletEvent::Eraser - An Eraser (the broad end of the pen).
78
81 globalPos, int device, int pressure, int xTilt, int yTilt, const
82 QPair<int, int> & uId )
83 Construct a tablet event of type t. The position of when the event
84 occurred is given int pos and globalPos. device contains the device
85 type, pressure contains the pressure exerted on the device, xTilt and
86 yTilt contain device's degree of tilt from the X and Y axis
87 respectively. The uId contains an event id.
88
89 On Irix, globalPos will contain the high-resolution coordinates
90 received from the tablet device driver, instead of from the windowing
91 system.
92
93 See also pos(), globalPos(), device(), pressure(), xTilt(), and
94 yTilt().
95
97 device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId
98 )
99 This function is obsolete. It is provided to keep old source working.
100 We strongly advise against using it in new code.
101
102 Constructs a tablet event object. The position when the event occurred
103 is is given in pos and globalPos. device contains the device type,
104 pressure contains the pressure exerted on the device, xTilt and yTilt
105 contain the device's degrees of tilt from the X and Y axis
106 respectively. The uId contains an event id.
107
108 On Irix, globalPos will contain the high-resolution coordinates
109 received from the tablet device driver, instead of from the windowing
110 system.
111
112 See also pos(), globalPos(), device(), pressure(), xTilt(), and
113 yTilt().
114
116 Sets the accept flag of the tablet event object.
117
118 Setting the accept flag indicates that the receiver of the event wants
119 the tablet event. Unwanted tablet events are sent to the parent widget.
120
121 The accept flag is set by default.
122
123 See also ignore().
124
126 Returns the type of device that generated the event. Useful if you want
127 one end of the pen to do something different than the other.
128
129 See also TabletDevice.
130
132 Returns the global position of the device at the time of the event.
133 This is important on asynchronous windows systems like X11; whenever
134 you move your widgets around in response to mouse events, globalPos()
135 can differ significantly from the current position QCursor::pos().
136
137 See also globalX() and globalY().
138
140 Returns the global x-position of the mouse pointer at the time of the
141 event.
142
143 See also globalY() and globalPos().
144
146 Returns the global y-position of the mouse pointer at the time of the
147 event.
148
149 See also globalX() and globalPos().
150
152 Clears the accept flag parameter of the tablet event object.
153
154 Clearing the accept flag indicates that the event receiver does not
155 want the tablet event. Unwanted tablet events are sent to the parent
156 widget.
157
158 The accept flag is set by default.
159
160 See also accept().
161
163 Returns TRUE if the receiver of the event handles the tablet event;
164 otherwise returns FALSE.
165
167 Returns the position of the device, relative to the widget that
168 received the event.
169
170 If you move widgets around in response to mouse events, use globalPos()
171 instead of this function.
172
173 See also x(), y(), and globalPos().
174
176 Returns the pressure that is exerted on the device. This number is a
177 value from 0 (no pressure) to 255 (maximum pressure). The pressure is
178 always scaled to be within this range no matter how many pressure
179 levels the underlying hardware supports.
180
182 Returns a unique ID for the current device. It is possible to generate
183 a unique ID for any Wacom© device. This makes it possible to
184 differentiate between multiple devices being used at the same time on
185 the tablet. The first member contains a value for the type, the second
186 member contains a physical ID obtained from the device. Each
187 combination of these values is unique. Note: for different platforms,
188 the first value is different due to different driver implementations.
189
191 Returns the x-position of the device, relative to the widget that
192 received the event.
193
194 See also y() and pos().
195
197 Returns the difference from the perpendicular in the X Axis. Positive
198 values are towards the tablet's physical right. The angle is in the
199 range -60 to +60 degrees.
200
201 See also yTilt().
202
204 Returns the y-position of the device, relative to the widget that
205 received the event.
206
207 See also x() and pos().
208
210 Returns the difference from the perpendicular in the Y Axis. Positive
211 values are towards the bottom of the tablet. The angle is within the
212 range -60 to +60 degrees.
213
214 See also xTilt().
215
216
218 http://doc.trolltech.com/qtabletevent.html
219 http://www.trolltech.com/faq/tech.html
220
222 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
223 license file included in the distribution for a complete license
224 statement.
225
227 Generated automatically from the source code.
228
230 If you find a bug in Qt, please report it as described in
231 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
232 help you. Thank you.
233
234 The definitive Qt documentation is provided in HTML format; it is
235 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
236 web browser. This man page is provided as a convenience for those users
237 who prefer man pages, although this format is not officially supported
238 by Trolltech.
239
240 If you find errors in this manual page, please report them to qt-
241 bugs@trolltech.com. Please include the name of the manual page
242 (qtabletevent.3qt) and the Qt version (3.3.8).
243
244
245
246Trolltech AS 2 February 2007 QTabletEvent(3qt)