[190] | 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:479 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QWheelEvent 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>QWheelEvent Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QWheelEvent class contains parameters that describe a wheel event.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qevent-h.html">qevent.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qevent.html">QEvent</a>.
|
---|
| 38 | <p><a href="qwheelevent-members.html">List of all member functions.</a>
|
---|
| 39 | <h2>Public Members</h2>
|
---|
| 40 | <ul>
|
---|
| 41 | <li class=fn><a href="#QWheelEvent"><b>QWheelEvent</b></a> ( const QPoint & pos, int delta, int state, Orientation orient = Vertical )</li>
|
---|
| 42 | <li class=fn><a href="#QWheelEvent-2"><b>QWheelEvent</b></a> ( const QPoint & pos, const QPoint & globalPos, int delta, int state, Orientation orient = Vertical )</li>
|
---|
| 43 | <li class=fn>int <a href="#delta"><b>delta</b></a> () const</li>
|
---|
| 44 | <li class=fn>const QPoint & <a href="#pos"><b>pos</b></a> () const</li>
|
---|
| 45 | <li class=fn>const QPoint & <a href="#globalPos"><b>globalPos</b></a> () const</li>
|
---|
| 46 | <li class=fn>int <a href="#x"><b>x</b></a> () const</li>
|
---|
| 47 | <li class=fn>int <a href="#y"><b>y</b></a> () const</li>
|
---|
| 48 | <li class=fn>int <a href="#globalX"><b>globalX</b></a> () const</li>
|
---|
| 49 | <li class=fn>int <a href="#globalY"><b>globalY</b></a> () const</li>
|
---|
| 50 | <li class=fn>ButtonState <a href="#state"><b>state</b></a> () const</li>
|
---|
| 51 | <li class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</li>
|
---|
| 52 | <li class=fn>bool <a href="#isAccepted"><b>isAccepted</b></a> () const</li>
|
---|
| 53 | <li class=fn>void <a href="#accept"><b>accept</b></a> ()</li>
|
---|
| 54 | <li class=fn>void <a href="#ignore"><b>ignore</b></a> ()</li>
|
---|
| 55 | </ul>
|
---|
| 56 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 57 |
|
---|
| 58 |
|
---|
| 59 | The QWheelEvent class contains parameters that describe a wheel event.
|
---|
| 60 | <p>
|
---|
| 61 | <p> Wheel events are sent to the widget under the mouse, and if that widget
|
---|
| 62 | does not handle the event they are sent to the focus widget. The rotation
|
---|
| 63 | distance is provided by <a href="#delta">delta</a>(). The functions <a href="#pos">pos</a>() and <a href="#globalPos">globalPos</a>() return
|
---|
| 64 | the mouse pointer location at the time of the event.
|
---|
| 65 | <p> A wheel event contains a special accept flag that indicates
|
---|
| 66 | whether the receiver wants the event. You should call
|
---|
| 67 | <a href="#accept">QWheelEvent::accept</a>() if you handle the wheel event; otherwise it
|
---|
| 68 | will be sent to the parent widget.
|
---|
| 69 | <p> The QWidget::setEnable() function can be used to enable or disable
|
---|
| 70 | mouse and keyboard events for a widget.
|
---|
| 71 | <p> The event handler <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>() receives wheel events.
|
---|
| 72 | <p> <p>See also <a href="qmouseevent.html">QMouseEvent</a>, <a href="qwidget.html#grabMouse">QWidget::grabMouse</a>(), and <a href="events.html">Event Classes</a>.
|
---|
| 73 |
|
---|
| 74 | <hr><h2>Member Function Documentation</h2>
|
---|
| 75 | <h3 class=fn><a name="QWheelEvent"></a>QWheelEvent::QWheelEvent ( const <a href="qpoint.html">QPoint</a> & pos, int delta, int state, <a href="qt.html#Orientation-enum">Orientation</a> orient = Vertical )
|
---|
| 76 | </h3>
|
---|
| 77 |
|
---|
| 78 | <p> Constructs a wheel event object.
|
---|
| 79 | <p> The <a href="#globalPos">globalPos</a>() is initialized to <a href="qcursor.html#pos">QCursor::pos</a>(), i.e. <em>pos</em>,
|
---|
| 80 | which is usually (but not always) right. Use the other constructor
|
---|
| 81 | if you need to specify the global position explicitly. <em>delta</em>
|
---|
| 82 | contains the rotation distance, <em>state</em> holds the keyboard
|
---|
| 83 | modifier flags at the time of the event and <em>orient</em> holds the
|
---|
| 84 | wheel's orientation.
|
---|
| 85 | <p> <p>See also <a href="#pos">pos</a>(), <a href="#delta">delta</a>(), and <a href="#state">state</a>().
|
---|
| 86 |
|
---|
| 87 | <h3 class=fn><a name="QWheelEvent-2"></a>QWheelEvent::QWheelEvent ( const <a href="qpoint.html">QPoint</a> & pos, const <a href="qpoint.html">QPoint</a> & globalPos, int delta, int state, <a href="qt.html#Orientation-enum">Orientation</a> orient = Vertical )
|
---|
| 88 | </h3>
|
---|
| 89 |
|
---|
| 90 | <p> Constructs a wheel event object. The position when the event
|
---|
| 91 | occurred is given in <em>pos</em> and <em>globalPos</em>. <em>delta</em> contains
|
---|
| 92 | the rotation distance, <em>state</em> holds the keyboard modifier flags
|
---|
| 93 | at the time of the event and <em>orient</em> holds the wheel's
|
---|
| 94 | orientation.
|
---|
| 95 | <p> <p>See also <a href="#pos">pos</a>(), <a href="#globalPos">globalPos</a>(), <a href="#delta">delta</a>(), and <a href="#state">state</a>().
|
---|
| 96 |
|
---|
| 97 | <h3 class=fn>void <a name="accept"></a>QWheelEvent::accept ()
|
---|
| 98 | </h3>
|
---|
| 99 |
|
---|
| 100 | <p> Sets the accept flag of the wheel event object.
|
---|
| 101 | <p> Setting the accept parameter indicates that the receiver of the
|
---|
| 102 | event wants the wheel event. Unwanted wheel events are sent to the
|
---|
| 103 | parent widget.
|
---|
| 104 | <p> The accept flag is set by default.
|
---|
| 105 | <p> <p>See also <a href="#ignore">ignore</a>().
|
---|
| 106 |
|
---|
| 107 | <h3 class=fn>int <a name="delta"></a>QWheelEvent::delta () const
|
---|
| 108 | </h3>
|
---|
| 109 |
|
---|
| 110 | <p> Returns the distance that the wheel is rotated expressed in
|
---|
| 111 | multiples or divisions of the <em>wheel delta</em>, which is currently
|
---|
| 112 | defined to be 120. A positive value indicates that the wheel was
|
---|
| 113 | rotated forwards away from the user; a negative value indicates
|
---|
| 114 | that the wheel was rotated backwards toward the user.
|
---|
| 115 | <p> The <em>wheel delta</em> constant was defined to be 120 by wheel mouse
|
---|
| 116 | vendors to allow building finer-resolution wheels in the future,
|
---|
| 117 | including perhaps a freely rotating wheel with no notches. The
|
---|
| 118 | expectation is that such a device would send more messages per
|
---|
| 119 | rotation but with a smaller value in each message.
|
---|
| 120 |
|
---|
| 121 | <h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="globalPos"></a>QWheelEvent::globalPos () const
|
---|
| 122 | </h3>
|
---|
| 123 |
|
---|
| 124 | <p> Returns the global position of the mouse pointer <em>at the time of the event</em>. This is important on asynchronous window systems
|
---|
| 125 | such as X11; whenever you move your widgets around in response to
|
---|
| 126 | mouse events, <a href="#globalPos">globalPos</a>() can differ a lot from the current
|
---|
| 127 | pointer position <a href="qcursor.html#pos">QCursor::pos</a>().
|
---|
| 128 | <p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalY">globalY</a>().
|
---|
| 129 |
|
---|
| 130 | <h3 class=fn>int <a name="globalX"></a>QWheelEvent::globalX () const
|
---|
| 131 | </h3>
|
---|
| 132 |
|
---|
| 133 | <p> Returns the global x-position of the mouse pointer at the time of
|
---|
| 134 | the event.
|
---|
| 135 | <p> <p>See also <a href="#globalY">globalY</a>() and <a href="#globalPos">globalPos</a>().
|
---|
| 136 |
|
---|
| 137 | <h3 class=fn>int <a name="globalY"></a>QWheelEvent::globalY () const
|
---|
| 138 | </h3>
|
---|
| 139 |
|
---|
| 140 | <p> Returns the global y-position of the mouse pointer at the time of
|
---|
| 141 | the event.
|
---|
| 142 | <p> <p>See also <a href="#globalX">globalX</a>() and <a href="#globalPos">globalPos</a>().
|
---|
| 143 |
|
---|
| 144 | <h3 class=fn>void <a name="ignore"></a>QWheelEvent::ignore ()
|
---|
| 145 | </h3>
|
---|
| 146 |
|
---|
| 147 | <p> Clears the accept flag parameter of the wheel event object.
|
---|
| 148 | <p> Clearing the accept parameter indicates that the event receiver
|
---|
| 149 | does not want the wheel event. Unwanted wheel events are sent to
|
---|
| 150 | the parent widget. The accept flag is set by default.
|
---|
| 151 | <p> <p>See also <a href="#accept">accept</a>().
|
---|
| 152 |
|
---|
| 153 | <h3 class=fn>bool <a name="isAccepted"></a>QWheelEvent::isAccepted () const
|
---|
| 154 | </h3>
|
---|
| 155 |
|
---|
| 156 | <p> Returns TRUE if the receiver of the event handles the wheel event;
|
---|
| 157 | otherwise returns FALSE.
|
---|
| 158 |
|
---|
| 159 | <h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QWheelEvent::orientation () const
|
---|
| 160 | </h3>
|
---|
| 161 |
|
---|
| 162 | <p> Returns the wheel's orientation.
|
---|
| 163 |
|
---|
| 164 | <h3 class=fn>const <a href="qpoint.html">QPoint</a> & <a name="pos"></a>QWheelEvent::pos () const
|
---|
| 165 | </h3>
|
---|
| 166 |
|
---|
| 167 | <p> Returns the position of the mouse pointer, relative to the widget
|
---|
| 168 | that received the event.
|
---|
| 169 | <p> If you move your widgets around in response to mouse
|
---|
| 170 | events, use <a href="#globalPos">globalPos</a>() instead of this function.
|
---|
| 171 | <p> <p>See also <a href="#x">x</a>(), <a href="#y">y</a>(), and <a href="#globalPos">globalPos</a>().
|
---|
| 172 |
|
---|
| 173 | <h3 class=fn><a href="qt.html#ButtonState-enum">ButtonState</a> <a name="state"></a>QWheelEvent::state () const
|
---|
| 174 | </h3>
|
---|
| 175 |
|
---|
| 176 | <p> Returns the keyboard modifier flags of the event.
|
---|
| 177 | <p> The returned value is <a href="qt.html#ButtonState-enum">ShiftButton</a>, <a href="qt.html#ButtonState-enum">ControlButton</a>, and <a href="qt.html#ButtonState-enum">AltButton</a> OR'ed together.
|
---|
| 178 |
|
---|
| 179 | <h3 class=fn>int <a name="x"></a>QWheelEvent::x () const
|
---|
| 180 | </h3>
|
---|
| 181 |
|
---|
| 182 | <p> Returns the x-position of the mouse pointer, relative to the
|
---|
| 183 | widget that received the event.
|
---|
| 184 | <p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().
|
---|
| 185 |
|
---|
| 186 | <h3 class=fn>int <a name="y"></a>QWheelEvent::y () const
|
---|
| 187 | </h3>
|
---|
| 188 |
|
---|
| 189 | <p> Returns the y-position of the mouse pointer, relative to the
|
---|
| 190 | widget that received the event.
|
---|
| 191 | <p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().
|
---|
| 192 |
|
---|
| 193 | <!-- eof -->
|
---|
| 194 | <hr><p>
|
---|
| 195 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 196 | Copyright © 1995-2007
|
---|
| 197 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 198 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 199 | <td>Copyright © 2007
|
---|
| 200 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 201 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 202 | </table></div></address></body>
|
---|
| 203 | </html>
|
---|