~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qwheelevent.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/kernel/qevent.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QWheelEvent Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QWheelEvent Class Reference</h1>
 
21
<p>The QWheelEvent class contains parameters that describe a wheel event. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QWheelEvent&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qinputevent.html">QInputEvent</a>.</p>
 
24
<ul>
 
25
<li><a href="qwheelevent-members.html">List of all members, including inherited members</a></li>
 
26
<li><a href="qwheelevent-qt3.html">Qt 3 support members</a></li>
 
27
</ul>
 
28
<a name="public-functions"></a>
 
29
<h3>Public Functions</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="qwheelevent.html#QWheelEvent">QWheelEvent</a></b> ( const QPoint &amp; <i>pos</i>, int <i>delta</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>, Qt::Orientation <i>orient</i> = Qt::Vertical )</li>
 
32
<li><div class="fn"/><b><a href="qwheelevent.html#QWheelEvent-2">QWheelEvent</a></b> ( const QPoint &amp; <i>pos</i>, const QPoint &amp; <i>globalPos</i>, int <i>delta</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>, Qt::Orientation <i>orient</i> = Qt::Vertical )</li>
 
33
<li><div class="fn"/>Qt::MouseButtons <b><a href="qwheelevent.html#buttons">buttons</a></b> () const</li>
 
34
<li><div class="fn"/>int <b><a href="qwheelevent.html#delta">delta</a></b> () const</li>
 
35
<li><div class="fn"/>const QPoint &amp; <b><a href="qwheelevent.html#globalPos">globalPos</a></b> () const</li>
 
36
<li><div class="fn"/>int <b><a href="qwheelevent.html#globalX">globalX</a></b> () const</li>
 
37
<li><div class="fn"/>int <b><a href="qwheelevent.html#globalY">globalY</a></b> () const</li>
 
38
<li><div class="fn"/>Qt::Orientation <b><a href="qwheelevent.html#orientation">orientation</a></b> () const</li>
 
39
<li><div class="fn"/>const QPoint &amp; <b><a href="qwheelevent.html#pos">pos</a></b> () const</li>
 
40
<li><div class="fn"/>int <b><a href="qwheelevent.html#x">x</a></b> () const</li>
 
41
<li><div class="fn"/>int <b><a href="qwheelevent.html#y">y</a></b> () const</li>
 
42
</ul>
 
43
<ul>
 
44
<li><div class="fn"/>1 public function inherited from <a href="qinputevent.html#public-functions">QInputEvent</a></li>
 
45
<li><div class="fn"/>6 public functions inherited from <a href="qevent.html#public-functions">QEvent</a></li>
 
46
</ul>
 
47
<h3>Additional Inherited Members</h3>
 
48
<ul>
 
49
<li><div class="fn"/>1 property inherited from <a href="qevent.html#properties">QEvent</a></li>
 
50
</ul>
 
51
<a name="details"></a>
 
52
<hr />
 
53
<h2>Detailed Description</h2>
 
54
<p>The QWheelEvent class contains parameters that describe a wheel event.</p>
 
55
<p>Wheel events are sent to the widget under the mouse cursor, but if that widget does not handle the event they are sent to the focus widget. The rotation distance is provided by <a href="qwheelevent.html#delta">delta</a>(). The functions <a href="qwheelevent.html#pos">pos</a>() and <a href="qwheelevent.html#globalPos">globalPos</a>() return the mouse cursor's location at the time of the event.</p>
 
56
<p>A wheel event contains a special accept flag that indicates whether the receiver wants the event. You should call <a href="qevent.html#ignore">ignore</a>() if you do not handle the wheel event; this ensures that it will be sent to the parent widget.</p>
 
57
<p>The <a href="qwidget.html#enabled-prop">QWidget::setEnabled</a>() function can be used to enable or disable mouse and keyboard events for a widget.</p>
 
58
<p>The event handler <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>() receives wheel events.</p>
 
59
<p>See also <a href="qmouseevent.html">QMouseEvent</a> and <a href="qwidget.html#grabMouse">QWidget::grabMouse</a>().</p>
 
60
<hr />
 
61
<h2>Member Function Documentation</h2>
 
62
<h3 class="fn"><a name="QWheelEvent"></a>QWheelEvent::QWheelEvent ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i>, int <i>delta</i>, <a href="qt.html#MouseButton-enum">Qt::MouseButtons</a> <i>buttons</i>, <a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a> <i>modifiers</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orient</i> = Qt::Vertical )</h3>
 
63
<p>Constructs a wheel event object.</p>
 
64
<p>The position, <i>pos</i>, is the location of the mouse cursor within the widget. The <a href="qwheelevent.html#globalPos">globalPos</a>() is initialized to <a href="qcursor.html#pos">QCursor::pos</a>() which is usually, but not always, correct. Use the other constructor if you need to specify the global position explicitly.</p>
 
65
<p>The <i>buttons</i> describe the state of the mouse buttons at the time of the event, <i>delta</i> contains the rotation distance, <i>modifiers</i> holds the keyboard modifier flags at the time of the event, and <i>orient</i> holds the wheel's orientation.</p>
 
66
<p>See also <a href="qwheelevent.html#pos">pos</a>(), <a href="qwheelevent.html#delta">delta</a>(), and <a href="qwheelevent-qt3.html#state">state</a>().</p>
 
67
<h3 class="fn"><a name="QWheelEvent-2"></a>QWheelEvent::QWheelEvent ( const <a href="qpoint.html">QPoint</a> &amp; <i>pos</i>, const <a href="qpoint.html">QPoint</a> &amp; <i>globalPos</i>, int <i>delta</i>, <a href="qt.html#MouseButton-enum">Qt::MouseButtons</a> <i>buttons</i>, <a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a> <i>modifiers</i>, <a href="qt.html#Orientation-enum">Qt::Orientation</a> <i>orient</i> = Qt::Vertical )</h3>
 
68
<p>Constructs a wheel event object.</p>
 
69
<p>The <i>pos</i> provides the location of the mouse cursor within the widget. The position in global coordinates is specified by <i>globalPos</i>. <i>delta</i> contains the rotation distance, <i>modifiers</i> holds the keyboard modifier flags at the time of the event, and <i>orient</i> holds the wheel's orientation.</p>
 
70
<p>See also <a href="qwheelevent.html#pos">pos</a>(), <a href="qwheelevent.html#globalPos">globalPos</a>(), <a href="qwheelevent.html#delta">delta</a>(), and <a href="qwheelevent-qt3.html#state">state</a>().</p>
 
71
<h3 class="fn"><a name="buttons"></a><a href="qt.html#MouseButton-enum">Qt::MouseButtons</a> QWheelEvent::buttons () const</h3>
 
72
<p>Returns the mouse state when the event occurred.</p>
 
73
<h3 class="fn"><a name="delta"></a>int QWheelEvent::delta () const</h3>
 
74
<p>Returns the distance that the wheel is rotated, given in multiples or divisions of <tt>WHEEL_DELTA</tt>. A positive value indicates that the wheel was rotated forwards away from the user; a negative value indicates that the wheel was rotated backwards toward the user.</p>
 
75
<p>The <tt>WHEEL_DELTA</tt> constant was defined to be 120 by the wheel mouse vendors to allow finer-resolution wheels to be built in the future, such as 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.</p>
 
76
<h3 class="fn"><a name="globalPos"></a>const <a href="qpoint.html">QPoint</a> &amp; QWheelEvent::globalPos () const</h3>
 
77
<p>Returns the global position of the mouse pointer <i>at the time of the event</i>. This is important on asynchronous window systems such as <a href="winsystem.html#x11">X11</a>; whenever you move your widgets around in response to mouse events, globalPos() can differ a lot from the current cursor position returned by <a href="qcursor.html#pos">QCursor::pos</a>().</p>
 
78
<p>See also <a href="qwheelevent.html#globalX">globalX</a>() and <a href="qwheelevent.html#globalY">globalY</a>().</p>
 
79
<h3 class="fn"><a name="globalX"></a>int QWheelEvent::globalX () const</h3>
 
80
<p>Returns the global x position of the mouse cursor at the time of the event.</p>
 
81
<p>See also <a href="qwheelevent.html#globalY">globalY</a>() and <a href="qwheelevent.html#globalPos">globalPos</a>().</p>
 
82
<h3 class="fn"><a name="globalY"></a>int QWheelEvent::globalY () const</h3>
 
83
<p>Returns the global y position of the mouse cursor at the time of the event.</p>
 
84
<p>See also <a href="qwheelevent.html#globalX">globalX</a>() and <a href="qwheelevent.html#globalPos">globalPos</a>().</p>
 
85
<h3 class="fn"><a name="orientation"></a><a href="qt.html#Orientation-enum">Qt::Orientation</a> QWheelEvent::orientation () const</h3>
 
86
<p>Returns the wheel's orientation.</p>
 
87
<h3 class="fn"><a name="pos"></a>const <a href="qpoint.html">QPoint</a> &amp; QWheelEvent::pos () const</h3>
 
88
<p>Returns the position of the mouse cursor relative to the widget that received the event.</p>
 
89
<p>If you move your widgets around in response to mouse events, use <a href="qwheelevent.html#globalPos">globalPos</a>() instead of this function.</p>
 
90
<p>See also <a href="qwheelevent.html#x">x</a>(), <a href="qwheelevent.html#y">y</a>(), and <a href="qwheelevent.html#globalPos">globalPos</a>().</p>
 
91
<h3 class="fn"><a name="x"></a>int QWheelEvent::x () const</h3>
 
92
<p>Returns the x position of the mouse cursor, relative to the widget that received the event.</p>
 
93
<p>See also <a href="qwheelevent.html#y">y</a>() and <a href="qwheelevent.html#pos">pos</a>().</p>
 
94
<h3 class="fn"><a name="y"></a>int QWheelEvent::y () const</h3>
 
95
<p>Returns the y position of the mouse cursor, relative to the widget that received the event.</p>
 
96
<p>See also <a href="qwheelevent.html#x">x</a>() and <a href="qwheelevent.html#pos">pos</a>().</p>
 
97
<p /><address><hr /><div align="center">
 
98
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
99
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
100
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
101
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
102
</tr></table></div></address></body>
 
103
</html>