qwheelevent.html

来自「QT 下载资料仅供参考」· HTML 代码 · 共 204 行

HTML
204
字号
<!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:464 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>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: #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&nbsp;Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped&nbsp;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>QWheelEvent Class Reference</h1><p>The QWheelEvent class contains parameters that describe a wheel event.<a href="#details">More...</a><p><tt>#include &lt;<a href="qevent-h.html">qevent.h</a>&gt;</tt><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="#QWheelEvent"><b>QWheelEvent</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos, int&nbsp;delta, int&nbsp;state, Orientation&nbsp;orient = Vertical )</div></li><li><div class=fn><a href="#QWheelEvent-2"><b>QWheelEvent</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos, const&nbsp;QPoint&nbsp;&amp;&nbsp;globalPos, int&nbsp;delta, int&nbsp;state, Orientation&nbsp;orient = Vertical )</div></li><li><div class=fn>int <a href="#delta"><b>delta</b></a> () const</div></li><li><div class=fn>const QPoint &amp; <a href="#pos"><b>pos</b></a> () const</div></li><li><div class=fn>const QPoint &amp; <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>ButtonState <a href="#state"><b>state</b></a> () const</div></li><li><div class=fn>Orientation <a href="#orientation"><b>orientation</b></a> () const</div></li><li><div class=fn>bool <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></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QWheelEvent class contains parameters that describe a wheel event.<p> <p> Wheel events occur when a mouse wheel is turned while the widgethas focus. The rotation distance is provided by <a href="#delta">delta</a>(). Thefunctions <a href="#pos">pos</a>() and <a href="#globalPos">globalPos</a>() return the mouse pointer locationat the time of the event.<p> A wheel event contains a special accept flag that indicateswhether the receiver wants the event. You should call<a href="#accept">QWheelEvent::accept</a>() if you handle the wheel event; otherwise itwill be sent to the parent widget.<p> The QWidget::setEnable() function can be used to enable or disablemouse and keyboard events for a widget.<p> The event handler <a href="qwidget.html#wheelEvent">QWidget::wheelEvent</a>() receives wheel events.<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>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QWheelEvent"></a>QWheelEvent::QWheelEvent ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos, int&nbsp;delta, int&nbsp;state, <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;orient = Vertical )</h3><p> Constructs a wheel 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) right. Use the other constructorif you need to specify the global position explicitly. <em>delta</em>contains the rotation distance, <em>state</em> holds the keyboardmodifier flags at the time of the event and <em>orient</em> holds thewheel's orientation.<p> <p>See also <a href="#pos">pos</a>(), <a href="#delta">delta</a>() and <a href="#state">state</a>().<h3 class=fn><a name="QWheelEvent-2"></a>QWheelEvent::QWheelEvent ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos, const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;globalPos, int&nbsp;delta, int&nbsp;state, <a href="qt.html#Orientation-enum">Orientation</a>&nbsp;orient = Vertical )</h3><p> Constructs a wheel event object. The position when the eventoccurred is given in <em>pos</em> and <em>globalPos</em>. <em>delta</em> containsthe rotation distance, <em>state</em> holds the keyboard modifier flagsat the time of the event and <em>orient</em> holds the wheel'sorientation.<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>().<h3 class=fn>void <a name="accept"></a>QWheelEvent::accept ()</h3><p> Sets the accept flag of the wheel event object.<p> Setting the accept parameter indicates that the receiver of theevent wants the wheel event. Unwanted wheel 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>int <a name="delta"></a>QWheelEvent::delta () const</h3><p> Returns the distance that the wheel is rotated expressed inmultiples or divisions of <tt>WHEEL_DELTA</tt>, which is currently setat 120. A positive value indicates that the wheel was rotatedforwards away from the user; a negative value indicates that thewheel was rotated backwards toward the user.<p> The <tt>WHEEL_DELTA</tt> constant was set to 120 by the wheel mousevendors to allow building finer-resolution wheels in the future,including perhaps a freely rotating wheel with no notches. Theexpectation is that such a device would send more messages perrotation but with a smaller value in each message.<h3 class=fn>const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp; <a name="globalPos"></a>QWheelEvent::globalPos () const</h3><p> Returns the global position of the mouse pointer <em>at the time of the event</em>. This is important on asynchronous window systemssuch as X11; whenever you move your widgets around in response tomouse events, <a href="#globalPos">globalPos</a>() can differ a lot from the currentpointer 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>QWheelEvent::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>QWheelEvent::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>QWheelEvent::ignore ()</h3><p> Clears the accept flag parameter of the wheel event object.<p> Clearing the accept parameter indicates that the event receiverdoes not want the wheel event. Unwanted wheel events are sent tothe parent widget. The accept flag is set by default.<p> <p>See also <a href="#accept">accept</a>().<h3 class=fn>bool <a name="isAccepted"></a>QWheelEvent::isAccepted () const</h3><p> Returns TRUE if the receiver of the event handles the wheel event;otherwise returns FALSE.<h3 class=fn><a href="qt.html#Orientation-enum">Orientation</a> <a name="orientation"></a>QWheelEvent::orientation () const</h3><p> Returns the wheel's orientation.<h3 class=fn>const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp; <a name="pos"></a>QWheelEvent::pos () const</h3><p> Returns the position of the mouse pointer, relative to the widgetthat received the event.<p> If you move your widgets around in response to mouseevents, 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><a href="qt.html#ButtonState-enum">ButtonState</a> <a name="state"></a>QWheelEvent::state () const</h3><p> Returns the keyboard modifier flags of the event.<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.<h3 class=fn>int <a name="x"></a>QWheelEvent::x () const</h3><p> Returns the x-position of the mouse pointer, relative to thewidget that received the event.<p> <p>See also <a href="#y">y</a>() and <a href="#pos">pos</a>().<h3 class=fn>int <a name="y"></a>QWheelEvent::y () const</h3><p> Returns the y-position of the mouse pointer, relative to thewidget that received the event.<p> <p>See also <a href="#x">x</a>() and <a href="#pos">pos</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 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 &copy; 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 + =
减小字号Ctrl + -
显示快捷键?