1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qevent.cpp:1900 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QTabletEvent Class</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QTabletEvent Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QTabletEvent class contains parameters that describe a Tablet
|
---|
35 | event.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt>
|
---|
38 | <p>Inherits <a href="qevent.html">QEvent</a>.
|
---|
39 | <p><a href="qtabletevent-members.html">List of all member functions.</a>
|
---|
40 | <h2>Public Members</h2>
|
---|
41 | <ul>
|
---|
42 | <li class=fn>enum <a href="#TabletDevice-enum"><b>TabletDevice</b></a> { NoDevice = -1, Puck, Stylus, Eraser }</li>
|
---|
43 | <li class=fn><a href="#QTabletEvent"><b>QTabletEvent</b></a> ( Type t, const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )</li>
|
---|
44 | <li class=fn>QTabletEvent ( const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId ) <em>(obsolete)</em></li>
|
---|
45 | <li class=fn>int <a href="#pressure"><b>pressure</b></a> () const</li>
|
---|
46 | <li class=fn>int <a href="#xTilt"><b>xTilt</b></a> () const</li>
|
---|
47 | <li class=fn>int <a href="#yTilt"><b>yTilt</b></a> () const</li>
|
---|
48 | <li class=fn>const QPoint & <a href="#pos"><b>pos</b></a> () const</li>
|
---|
49 | <li class=fn>const QPoint & <a href="#globalPos"><b>globalPos</b></a> () const</li>
|
---|
50 | <li class=fn>int <a href="#x"><b>x</b></a> () const</li>
|
---|
51 | <li class=fn>int <a href="#y"><b>y</b></a> () const</li>
|
---|
52 | <li class=fn>int <a href="#globalX"><b>globalX</b></a> () const</li>
|
---|
53 | <li class=fn>int <a href="#globalY"><b>globalY</b></a> () const</li>
|
---|
54 | <li class=fn>TabletDevice <a href="#device"><b>device</b></a> () const</li>
|
---|
55 | <li class=fn>int <a href="#isAccepted"><b>isAccepted</b></a> () const</li>
|
---|
56 | <li class=fn>void <a href="#accept"><b>accept</b></a> ()</li>
|
---|
57 | <li class=fn>void <a href="#ignore"><b>ignore</b></a> ()</li>
|
---|
58 | <li class=fn>QPair<int, int> <a href="#uniqueId"><b>uniqueId</b></a> ()</li>
|
---|
59 | </ul>
|
---|
60 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
61 |
|
---|
62 |
|
---|
63 | The QTabletEvent class contains parameters that describe a Tablet
|
---|
64 | event.
|
---|
65 | <p>
|
---|
66 | <p> Tablet Events are generated from a Wacom© tablet. Most of
|
---|
67 | the time you will want to deal with events from the tablet as if
|
---|
68 | they were events from a mouse, for example retrieving the position
|
---|
69 | with <a href="#x">x</a>(), <a href="#y">y</a>(), <a href="#pos">pos</a>(), <a href="#globalX">globalX</a>(), <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>(). In
|
---|
70 | some situations you may wish to retrieve the extra information
|
---|
71 | provided by the tablet device driver, for example, you might want
|
---|
72 | to adjust color brightness based on pressure. QTabletEvent allows
|
---|
73 | you to get the <a href="#pressure">pressure</a>(), the <a href="#xTilt">xTilt</a>() and <a href="#yTilt">yTilt</a>(), as well as the
|
---|
74 | type of device being used with <a href="#device">device</a>() (see <a href="#TabletDevice-enum">TabletDevice</a>).
|
---|
75 | <p> A tablet event contains a special accept flag that indicates
|
---|
76 | whether the receiver wants the event. You should call
|
---|
77 | <a href="#accept">QTabletEvent::accept</a>() if you handle the tablet event; otherwise
|
---|
78 | it will be sent to the parent widget.
|
---|
79 | <p> The <a href="qwidget.html#setEnabled">QWidget::setEnabled</a>() function can be used to enable or
|
---|
80 | disable mouse and keyboard events for a widget.
|
---|
81 | <p> The event handler <a href="qwidget.html#tabletEvent">QWidget::tabletEvent</a>() receives all three types of tablet
|
---|
82 | events. Qt will first send a tabletEvent and then, if it is not accepted,
|
---|
83 | it will send a mouse event. This allows applications that don't utilize
|
---|
84 | tablets to use a tablet like a mouse while also enabling those who want to
|
---|
85 | use both tablets and mouses differently.
|
---|
86 | <p> <p>See also <a href="events.html">Event Classes</a>.
|
---|
87 |
|
---|
88 | <hr><h2>Member Type Documentation</h2>
|
---|
89 | <h3 class=fn><a name="TabletDevice-enum"></a>QTabletEvent::TabletDevice</h3>
|
---|
90 |
|
---|
91 | <p> This enum defines what type of device is generating the event.
|
---|
92 | <ul>
|
---|
93 | <li><tt>QTabletEvent::NoDevice</tt> - No device, or an unknown device.
|
---|
94 | <li><tt>QTabletEvent::Puck</tt> - A Puck (a device that is similar to a flat mouse with
|
---|
95 | a transparent circle with cross-hairs).
|
---|
96 | <li><tt>QTabletEvent::Stylus</tt> - A Stylus (the narrow end of the pen).
|
---|
97 | <li><tt>QTabletEvent::Eraser</tt> - An Eraser (the broad end of the pen).
|
---|
98 | </ul>
|
---|
99 | <hr><h2>Member Function Documentation</h2>
|
---|
100 | <h3 class=fn><a name="QTabletEvent"></a>QTabletEvent::QTabletEvent ( <a href="qevent.html#Type-enum">Type</a> t, const <a href="qpoint.html">QPoint</a> & pos, const <a href="qpoint.html">QPoint</a> & globalPos, int device, int pressure, int xTilt, int yTilt, const <a href="qpair.html">QPair</a><int, int> & uId )
|
---|
101 | </h3>
|
---|
102 |
|
---|
103 | Construct a tablet event of type <em>t</em>. The position of when the event occurred is given
|
---|
104 | int <em>pos</em> and <em>globalPos</em>. <em>device</em> contains the <a href="#TabletDevice-enum">device type</a>,
|
---|
105 | <em>pressure</em> contains the pressure exerted on the <em>device</em>, <em>xTilt</em> and <em>yTilt</em> contain
|
---|
106 | <em>device</em>'s degree of tilt from the X and Y axis respectively. The <em>uId</em> contains an
|
---|
107 | event id.
|
---|
108 | <p> On Irix, <em>globalPos</em> will contain the high-resolution coordinates received from the
|
---|
109 | tablet device driver, instead of from the windowing system.
|
---|
110 | <p> <p>See also <a href="#pos">pos</a>(), <a href="#globalPos">globalPos</a>(), <a href="#device">device</a>(), <a href="#pressure">pressure</a>(), <a href="#xTilt">xTilt</a>(), and <a href="#yTilt">yTilt</a>().
|
---|
111 |
|
---|
112 | <h3 class=fn><a name="QTabletEvent-2"></a>QTabletEvent::QTabletEvent ( const <a href="qpoint.html">QPoint</a> & pos, const <a href="qpoint.html">QPoint</a> & globalPos, int device, int pressure, int xTilt, int yTilt, const <a href="qpair.html">QPair</a><int, int> & uId )
|
---|
113 | </h3>
|
---|
114 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
115 | <p>
|
---|
116 | <p> Constructs a tablet event object. The position when the event
|
---|
117 | occurred is is given in <em>pos</em> and <em>globalPos</em>. <em>device</em>
|
---|
118 | contains the <a href="#TabletDevice-enum">device type</a>, <em>pressure</em>
|
---|
119 | contains the pressure exerted on the <em>device</em>, <em>xTilt</em> and <em>yTilt</em> contain the <em>device</em>'s degrees of tilt from the X and Y
|
---|
120 | axis respectively. The <em>uId</em> contains an event id.
|
---|
121 | <p> On Irix, <em>globalPos</em> will contain the high-resolution coordinates
|
---|
122 | received from the tablet device driver, instead of from the
|
---|
123 | windowing system.
|
---|
124 | <p> <p>See also <a href="#pos">pos</a>(), <a href="#globalPos">globalPos</a>(), <a href="#device">device</a>(), <a href="#pressure">pressure</a>(), <a href="#xTilt">xTilt</a>(), and <a href="#yTilt">yTilt</a>().
|
---|
125 |
|
---|
126 | <h3 class=fn>void <a name="accept"></a>QTabletEvent::accept ()
|
---|
127 | </h3>
|
---|
128 |
|
---|
129 | <p> Sets the accept flag of the tablet event object.
|
---|
130 | <p> Setting the accept flag indicates that the receiver of the event
|
---|
131 | wants the tablet event. Unwanted tablet events are sent to the
|
---|
132 | parent widget.
|
---|
133 | <p> The accept flag is set by default.
|
---|
134 | <p> <p>See also <a href="#ignore">ignore</a>().
|
---|
135 |
|
---|
136 | <h3 class=fn><a href="qtabletevent.html#TabletDevice-enum">TabletDevice</a> <a name="device"></a>QTabletEvent::device () const
|
---|
137 | </h3>
|
---|
138 |
|
---|
139 | <p> Returns the type of device that generated the event. Useful if you
|
---|
140 | want one end of the pen to do something different than the other.
|
---|
141 | <p> <p>See also <a href="#TabletDevice-enum">TabletDevice</a>.
|
---|
142 |
|
---|
143 | <h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="globalPos"></a>QTabletEvent::globalPos () const
|
---|
144 | </h3>
|
---|
145 |
|
---|
146 | <p> Returns the global position of the device <em>at the time of the event</em>. This is important on asynchronous windows systems like X11;
|
---|
147 | whenever you move your widgets around in response to mouse events,
|
---|
148 | <a href="#globalPos">globalPos</a>() can differ significantly from the current position
|
---|
149 | <a href="qcursor.html#pos">QCursor::pos</a>().
|
---|
150 | <p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalY">globalY</a>().
|
---|
151 |
|
---|
152 | <h3 class=fn>int <a name="globalX"></a>QTabletEvent::globalX () const
|
---|
153 | </h3>
|
---|
154 |
|
---|
155 | <p> Returns the global x-position of the mouse pointer at the time of
|
---|
156 | the event.
|
---|
157 | <p> <p>See also <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>().
|
---|
158 |
|
---|
159 | <h3 class=fn>int <a name="globalY"></a>QTabletEvent::globalY () const
|
---|
160 | </h3>
|
---|
161 |
|
---|
162 | <p> Returns the global y-position of the mouse pointer at the time of
|
---|
163 | the event.
|
---|
164 | <p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalPos">globalPos</a>().
|
---|
165 |
|
---|
166 | <h3 class=fn>void <a name="ignore"></a>QTabletEvent::ignore ()
|
---|
167 | </h3>
|
---|
168 |
|
---|
169 | <p> Clears the accept flag parameter of the tablet event object.
|
---|
170 | <p> Clearing the accept flag indicates that the event receiver does
|
---|
171 | not want the tablet event. Unwanted tablet events are sent to the
|
---|
172 | parent widget.
|
---|
173 | <p> The accept flag is set by default.
|
---|
174 | <p> <p>See also <a href="#accept">accept</a>().
|
---|
175 |
|
---|
176 | <h3 class=fn>int <a name="isAccepted"></a>QTabletEvent::isAccepted () const
|
---|
177 | </h3>
|
---|
178 |
|
---|
179 | <p> Returns TRUE if the receiver of the event handles the tablet
|
---|
180 | event; otherwise returns FALSE.
|
---|
181 |
|
---|
182 | <h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="pos"></a>QTabletEvent::pos () const
|
---|
183 | </h3>
|
---|
184 |
|
---|
185 | <p> Returns the position of the device, relative to the widget that
|
---|
186 | received the event.
|
---|
187 | <p> If you move widgets around in response to mouse events, use
|
---|
188 | <a href="#globalPos">globalPos</a>() instead of this function.
|
---|
189 | <p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#globalPos">globalPos</a>().
|
---|
190 |
|
---|
191 | <h3 class=fn>int <a name="pressure"></a>QTabletEvent::pressure () const
|
---|
192 | </h3>
|
---|
193 |
|
---|
194 | <p> Returns the pressure that is exerted on the device. This number is
|
---|
195 | a value from 0 (no pressure) to 255 (maximum pressure). The
|
---|
196 | pressure is always scaled to be within this range no matter how
|
---|
197 | many pressure levels the underlying hardware supports.
|
---|
198 |
|
---|
199 | <h3 class=fn><a href="qpair.html">QPair</a><int, int> <a name="uniqueId"></a>QTabletEvent::uniqueId ()
|
---|
200 | </h3>
|
---|
201 |
|
---|
202 | <p> Returns a unique ID for the current device. It is possible to
|
---|
203 | generate a unique ID for any Wacom© device. This makes it
|
---|
204 | possible to differentiate between multiple devices being used at
|
---|
205 | the same time on the tablet. The <tt>first</tt> member contains a value
|
---|
206 | for the type, the <tt>second</tt> member contains a physical ID obtained
|
---|
207 | from the device. Each combination of these values is unique. Note:
|
---|
208 | for different platforms, the <tt>first</tt> value is different due to
|
---|
209 | different driver implementations.
|
---|
210 |
|
---|
211 | <h3 class=fn>int <a name="x"></a>QTabletEvent::x () const
|
---|
212 | </h3>
|
---|
213 |
|
---|
214 | <p> Returns the x-position of the device, relative to the widget that
|
---|
215 | received the event.
|
---|
216 | <p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().
|
---|
217 |
|
---|
218 | <h3 class=fn>int <a name="xTilt"></a>QTabletEvent::xTilt () const
|
---|
219 | </h3>
|
---|
220 |
|
---|
221 | <p> Returns the difference from the perpendicular in the X Axis.
|
---|
222 | Positive values are towards the tablet's physical right. The angle
|
---|
223 | is in the range -60 to +60 degrees.
|
---|
224 | <p> <p>See also <a href="#yTilt">yTilt</a>().
|
---|
225 |
|
---|
226 | <h3 class=fn>int <a name="y"></a>QTabletEvent::y () const
|
---|
227 | </h3>
|
---|
228 |
|
---|
229 | <p> Returns the y-position of the device, relative to the widget that
|
---|
230 | received the event.
|
---|
231 | <p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().
|
---|
232 |
|
---|
233 | <h3 class=fn>int <a name="yTilt"></a>QTabletEvent::yTilt () const
|
---|
234 | </h3>
|
---|
235 |
|
---|
236 | <p> Returns the difference from the perpendicular in the Y Axis.
|
---|
237 | Positive values are towards the bottom of the tablet. The angle is
|
---|
238 | within the range -60 to +60 degrees.
|
---|
239 | <p> <p>See also <a href="#xTilt">xTilt</a>().
|
---|
240 |
|
---|
241 | <!-- eof -->
|
---|
242 | <hr><p>
|
---|
243 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
244 | Copyright © 1995-2007
|
---|
245 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
246 | <table width=100% cellspacing=0 border=0><tr>
|
---|
247 | <td>Copyright © 2007
|
---|
248 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
249 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
250 | </table></div></address></body>
|
---|
251 | </html>
|
---|