1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QWheelEvent 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: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QWheelEvent Class Reference</h1><br clear="all">
<p>
The QWheelEvent class contains parameters that describe a wheel event.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qevent-h.html">qevent.h</a>></code>
<p>
Inherits <a href="qevent.html">QEvent</a>.
<p><a href="qwheelevent-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#8657da"><b>QWheelEvent</b></a>(constQPoint&pos, intdelta, intstate)</div>
<li><div class="fn"><a href="#1dc743"><b>QWheelEvent</b></a>(constQPoint&pos, constQPoint&globalPos, intdelta, intstate)</div>
<li><div class="fn">int<a href="#c4bc31"><b>delta</b></a>()const</div>
<li><div class="fn">constQPoint&<a href="#ca30fd"><b>pos</b></a>()const</div>
<li><div class="fn">constQPoint&<a href="#1f1ebd"><b>globalPos</b></a>()const</div>
<li><div class="fn">int<a href="#832d14"><b>x</b></a>()const</div>
<li><div class="fn">int<a href="#710814"><b>y</b></a>()const</div>
<li><div class="fn">int<a href="#2ac9f5"><b>globalX</b></a>()const</div>
<li><div class="fn">int<a href="#d89745"><b>globalY</b></a>()const</div>
<li><div class="fn">ButtonState<a href="#a5e16d"><b>state</b></a>()const</div>
<li><div class="fn">bool<a href="#ebc0b9"><b>isAccepted</b></a>()const</div>
<li><div class="fn">void<a href="#33c440"><b>accept</b></a>()</div>
<li><div class="fn">void<a href="#e00588"><b>ignore</b></a>()</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QWheelEvent class contains parameters that describe a wheel event.
<p>
Wheel events occur when a mouse wheel is turned while the widget has
focus. The rotation distance is provided by <a href="#c4bc31">delta</a>(). The functions
<a href="#ca30fd">pos</a>() and <a href="#1f1ebd">globalPos</a>() return the mouse pointer location at the
time of the event.
<p>A wheel event contains a special accept flag which tells whether the
receiver wants the event. You should call <a href="#33c440">QWheelEvent::accept</a>() if you
handle the wheel event, otherwise it will be sent to the parent widget.
<p>The QWidget::setEnable() function can be used to enable or disable mouse
and keyboard events for a widget.
<p>The event handler <a href="qwidget.html#6f6c80">QWidget::wheelEvent</a>() receive wheel events.
<p>See also <a href="qmouseevent.html">QMouseEvent</a> and <a href="qwidget.html#5bdd5f">QWidget::grabMouse</a>().
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="1dc743"></a>QWheelEvent::QWheelEvent(const<a href="qpoint.html">QPoint</a>&pos, const<a href="qpoint.html">QPoint</a>&globalPos, intdelta, intstate)</h3>
<p>Constructs a wheel event object.
<p>See also <a href="#ca30fd">pos</a>(), <a href="#1f1ebd">globalPos</a>(), <a href="#c4bc31">delta</a>() and <a href="#a5e16d">state</a>().
<h3 class="fn"><a name="8657da"></a>QWheelEvent::QWheelEvent(const<a href="qpoint.html">QPoint</a>&pos, intdelta, intstate)</h3>
<p>Constructs a wheel event object.
<p>The <a href="#1f1ebd">globalPos</a>() is initialized to <a href="qcursor.html#5bce2b">QCursor::pos</a>(), which usually is
right but not always. Use the other constructor if you need to
specify the global position explicitly.
<p>See also <a href="#ca30fd">pos</a>(), <a href="#c4bc31">delta</a>() and <a href="#a5e16d">state</a>().
<h3 class="fn">void<a name="33c440"></a>QWheelEvent::accept()</h3>
<p>Sets the accept flag of the wheel event object.
<p>Setting the accept parameter indicates that the receiver of the event wants
the wheel event. Unwanted wheel events are sent to the parent widget.
<p>The accept flag is set by default.
<p>See also <a href="#e00588">ignore</a>().
<h3 class="fn">int<a name="c4bc31"></a>QWheelEvent::delta()const</h3>
<p>Returns the distance that the wheel is rotated, expressed in
multiples or divisions of WHEEL_DELTA, which is set at 120
currently.A positive value indicates that the wheel was rotated
forward, away from the user; a negative value indicates that the
wheel was rotated backward, toward the user.
<p>The WHEEL_DELTA constant was set to 120 by the wheel mouse vendors
to allow building finer-resolution wheels in the future, including
perhaps a freely-rotating wheel with no notches. The expectation is
that such a device would send more messages per rotation, but with a
smaller value in each message.
<h3 class="fn">const<a href="qpoint.html">QPoint</a>&<a name="1f1ebd"></a>QWheelEvent::globalPos()const</h3>
<p>Returns the global position of the mouse pointer <em>at the time</em> of the event. This is important on asynchronous window systems
like X11: Whenever you move your widgets around in response to mouse
evens, globalPos() can differ a lot from the current pointer
position <a href="qcursor.html#5bce2b">QCursor::pos</a>().
<p>See also <a href="#2ac9f5">globalX</a>() and <a href="#d89745">globalY</a>().
<h3 class="fn">int<a name="2ac9f5"></a>QWheelEvent::globalX()const</h3>
<p>Returns the global X position of the mouse pointer at the time of the event
<p>See also <a href="#d89745">globalY</a>() and <a href="#1f1ebd">globalPos</a>().
<h3 class="fn">int<a name="d89745"></a>QWheelEvent::globalY()const</h3>
<p>Returns the global Y position of the mouse pointer at the time of the event
<p>See also <a href="#2ac9f5">globalX</a>() and <a href="#1f1ebd">globalPos</a>().
<h3 class="fn">void<a name="e00588"></a>QWheelEvent::ignore()</h3>
<p>Clears the accept flag parameter of the wheel event object.
<p>Clearing the accept parameter indicates that the event receiver does
not want the wheel event. Unwanted wheel events are sent to the parent widget.
The accept flag is set by default.
<p>See also <a href="#33c440">accept</a>().
<h3 class="fn">bool<a name="ebc0b9"></a>QWheelEvent::isAccepted()const</h3>
<p>Returns TRUE if the receiver of the event handles the wheel event.
<h3 class="fn">const<a href="qpoint.html">QPoint</a>&<a name="ca30fd"></a>QWheelEvent::pos()const</h3>
<p>Returns the position of the mouse pointer, relative to the widget that
received the event.
<p>If you move your widgets around in response to mouse
evens, use <a href="#1f1ebd">globalPos</a>() instead of this function.
<p>See also <a href="#832d14">x</a>(), <a href="#710814">y</a>() and <a href="#1f1ebd">globalPos</a>().
<h3 class="fn"><a href="qt.html#ButtonState">ButtonState</a><a name="a5e16d"></a>QWheelEvent::state()const</h3>
<p>Returns the keyboard modifier flags of the event.
<p>The returned value is <code>ShiftButton, ControlButton</code> and <code>AltButton</code>
OR'ed together.
<h3 class="fn">int<a name="832d14"></a>QWheelEvent::x()const</h3>
<p>Returns the X position of the mouse pointer, relative to the widget that
received the event.
<p>See also <a href="#710814">y</a>() and <a href="#ca30fd">pos</a>().
<h3 class="fn">int<a name="710814"></a>QWheelEvent::y()const</h3>
<p>Returns the Y position of the mouse pointer, relative to the widget that
received the event.
<p>See also <a href="#832d14">x</a>() and <a href="#ca30fd">pos</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.2"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2001
<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 2001 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.2</div>
</table></div></address></body></html>
|