📄 qtabletevent.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qevent.cpp:1762 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QTabletEvent Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><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><p>The QTabletEvent class contains parameters that describe a Tabletevent.<a href="#details">More...</a><p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt><p>Inherits <a href="qevent.html">QEvent</a>.<p><a href="qtabletevent-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn>enum <a href="#TabletDevice-enum"><b>TabletDevice</b></a> { NoDevice = -1, Puck, Stylus, Eraser }</div></li><li><div class=fn><a href="#QTabletEvent"><b>QTabletEvent</b></a> ( const QPoint & pos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )</div></li><li><div class=fn><a href="#QTabletEvent-2"><b>QTabletEvent</b></a> ( const QPoint & pos, const QPoint & globalPos, int device, int pressure, int xTilt, int yTilt, const QPair<int, int> & uId )</div></li><li><div class=fn>int <a href="#pressure"><b>pressure</b></a> () const</div></li><li><div class=fn>int <a href="#xTilt"><b>xTilt</b></a> () const</div></li><li><div class=fn>int <a href="#yTilt"><b>yTilt</b></a> () const</div></li><li><div class=fn>const QPoint & <a href="#pos"><b>pos</b></a> () const</div></li><li><div class=fn>const QPoint & <a href="#globalPos"><b>globalPos</b></a> () const</div></li><li><div class=fn>int <a href="#x"><b>x</b></a> () const</div></li><li><div class=fn>int <a href="#y"><b>y</b></a> () const</div></li><li><div class=fn>int <a href="#globalX"><b>globalX</b></a> () const</div></li><li><div class=fn>int <a href="#globalY"><b>globalY</b></a> () const</div></li><li><div class=fn>TabletDevice <a href="#device"><b>device</b></a> () const</div></li><li><div class=fn>int <a href="#isAccepted"><b>isAccepted</b></a> () const</div></li><li><div class=fn>void <a href="#accept"><b>accept</b></a> ()</div></li><li><div class=fn>void <a href="#ignore"><b>ignore</b></a> ()</div></li><li><div class=fn>QPair<int, int> <a href="#uniqueId"><b>uniqueId</b></a> ()</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QTabletEvent class contains parameters that describe a Tabletevent.<p> <p> Tablet Events are generated from a Wacom© tablet. Most ofthe time you will want to deal with events from the tablet as ifthey were events from a mouse, for example retrieving the positionwith <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>(). Insome situations you may wish to retrieve the extra informationprovided by the tablet device driver, for example, you might wantto adjust color brightness based on pressure. QTabletEvent allowsyou to get the <a href="#pressure">pressure</a>(), the <a href="#xTilt">xTilt</a>() and <a href="#yTilt">yTilt</a>(), as well as thetype of device being used with <a href="#device">device</a>() (see <a href="#TabletDevice-enum">TabletDevice</a>).<p> A tablet event contains a special accept flag that indicateswhether the receiver wants the event. You should call<a href="#accept">QTabletEvent::accept</a>() if you handle the tablet event; otherwiseit will be sent to the parent widget.<p> The <a href="qwidget.html#setEnabled">QWidget::setEnabled</a>() function can be used to enable ordisable mouse and keyboard events for a widget.<p> The event handler <a href="qwidget.html#tabletEvent">QWidget::tabletEvent</a>() receives tablet events.<p> <p>See also <a href="events.html">Event Classes</a>.<hr><h2>Member Type Documentation</h2><h3 class=fn><a name="TabletDevice-enum"></a>QTabletEvent::TabletDevice</h3><p> This enum defines what type of device is generating the event.<ul><li><tt>QTabletEvent::NoDevice</tt> - No device, or an unknown device.<li><tt>QTabletEvent::Puck</tt> - A Puck (a device that is similar to a flat mouse witha transparent circle with cross-hairs).<li><tt>QTabletEvent::Stylus</tt> - A Stylus (the narrow end of the pen).<li><tt>QTabletEvent::Eraser</tt> - An Eraser (the broad end of the pen).</ul><hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QTabletEvent"></a>QTabletEvent::QTabletEvent ( const <a href="qpoint.html">QPoint</a> & pos, int device, int pressure, int xTilt, int yTilt, const <a href="qpair.html">QPair</a><int, int> & uId )</h3><p> Constructs a tablet event object.<p> The <a href="#globalPos">globalPos</a>() is initialized to <a href="qcursor.html#pos">QCursor::pos</a>(), i.e. <em>pos</em>,which is usually (but not always) correct. Use the otherconstructor if you need to specify the global position explicitly.<em>device</em> contains the <a href="#TabletDevice-enum">device type</a>, <em>pressure</em> 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 Xand Y axis respectively. The <em>uId</em> contains an event id.<p> <p>See also <a href="#pos">pos</a>(), <a href="#device">device</a>(), <a href="#pressure">pressure</a>(), <a href="#xTilt">xTilt</a>() and <a href="#yTilt">yTilt</a>().<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 )</h3><p> Constructs a tablet event object. The position when the eventoccurred is is given in <em>pos</em> and <em>globalPos</em>. <em>device</em>contains the <a href="#TabletDevice-enum">device type</a>, <em>pressure</em>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 Yaxis respectively. The <em>uId</em> contains an event id.<p> On Irix, <em>globalPos</em> will contain the high-resolution coordinatesreceived from the tablet device driver, instead of from thewindowing system.<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>().<h3 class=fn>void <a name="accept"></a>QTabletEvent::accept ()</h3><p> Sets the accept flag of the tablet event object.<p> Setting the accept flag indicates that the receiver of the eventwants the tablet event. Unwanted tablet events are sent to theparent widget.<p> The accept flag is set by default.<p> <p>See also <a href="#ignore">ignore</a>().<h3 class=fn><a href="qtabletevent.html#TabletDevice-enum">TabletDevice</a> <a name="device"></a>QTabletEvent::device () const</h3><p> Returns the type of device that generated the event. Useful if youwant one end of the pen to do something different than the other.<p> <p>See also <a href="#TabletDevice-enum">TabletDevice</a>.<h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="globalPos"></a>QTabletEvent::globalPos () const</h3><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;whenever you move your widgets around in response to mouse events,<a href="#globalPos">globalPos</a>() can differ significantly from the current position<a href="qcursor.html#pos">QCursor::pos</a>().<p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalY">globalY</a>().<h3 class=fn>int <a name="globalX"></a>QTabletEvent::globalX () const</h3><p> Returns the global x-position of the mouse pointer at the time ofthe event.<p> <p>See also <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>().<h3 class=fn>int <a name="globalY"></a>QTabletEvent::globalY () const</h3><p> Returns the global y-position of the mouse pointer at the time ofthe event.<p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalPos">globalPos</a>().<h3 class=fn>void <a name="ignore"></a>QTabletEvent::ignore ()</h3><p> Clears the accept flag parameter of the tablet event object.<p> Clearing the accept flag indicates that the event receiver doesnot want the tablet event. Unwanted tablet events are sent to theparent widget.<p> The accept flag is set by default.<p> <p>See also <a href="#accept">accept</a>().<h3 class=fn>int <a name="isAccepted"></a>QTabletEvent::isAccepted () const</h3><p> Returns TRUE if the receiver of the event handles the tabletevent; otherwise returns FALSE.<h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="pos"></a>QTabletEvent::pos () const</h3><p> Returns the position of the device, relative to the widget thatreceived the event.<p> If you move widgets around in response to mouse events, use<a href="#globalPos">globalPos</a>() instead of this function.<p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>() and <a href="#globalPos">globalPos</a>().<h3 class=fn>int <a name="pressure"></a>QTabletEvent::pressure () const</h3><p> Returns the pressure that is exerted on the device. This number isa value from 0 (no pressure) to 255 (maximum pressure). Thepressure is always scaled to be within this range no matter howmany pressure levels the underlying hardware supports.<h3 class=fn><a href="qpair.html">QPair</a><int, int> <a name="uniqueId"></a>QTabletEvent::uniqueId ()</h3><p> Returns a unique ID for the current device. It is possible togenerate a unique ID for any Wacom© device. This makes itpossible to differentiate between multiple devices being used atthe same time on the tablet. The <tt>first</tt> member contains a valuefor the type, the <tt>second</tt> member contains a physical ID obtainedfrom the device. Each combination of these values is unique. Note:for different platforms, the <tt>first</tt> value is different due todifferent driver implementations.<h3 class=fn>int <a name="x"></a>QTabletEvent::x () const</h3><p> Returns the x-position of the device, relative to the widget thatreceived the event.<p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().<h3 class=fn>int <a name="xTilt"></a>QTabletEvent::xTilt () const</h3><p> Returns the difference from the perpendicular in the X Axis.Positive values are towards the tablet's physical right. The angleis in the range -60 to +60 degrees.<p> <p>See also <a href="#yTilt">yTilt</a>().<h3 class=fn>int <a name="y"></a>QTabletEvent::y () const</h3><p> Returns the y-position of the device, relative to the widget thatreceived the event.<p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().<h3 class=fn>int <a name="yTilt"></a>QTabletEvent::yTilt () const</h3><p> Returns the difference from the perpendicular in the Y Axis.Positive values are towards the bottom of the tablet. The angle iswithin the range -60 to +60 degrees.<p> <p>See also <a href="#xTilt">xTilt</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -