Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 1724

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qevent.cpp -->
  <title>QWheelEvent Class | Qt GUI 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QWheelEvent</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QWheelEvent Class</h1>
<!-- $$$QWheelEvent-brief -->
<p>The <a href="qwheelevent.html">QWheelEvent</a> class contains parameters that describe a wheel event. <a href="#details">More...</a></p>
<!-- @@@QWheelEvent -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QWheelEvent&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += gui</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qinputevent.html">QInputEvent</a></td></tr></table></div><ul>
<li><a href="qwheelevent-members.html">List of all members, including inherited members</a></li>
<li><a href="qwheelevent-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#QWheelEvent">QWheelEvent</a></b>(const QPointF &amp;<i>pos</i>, const QPointF &amp;<i>globalPos</i>, QPoint <i>pixelDelta</i>, QPoint <i>angleDelta</i>, int <i>qt4Delta</i>, Qt::Orientation <i>qt4Orientation</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#QWheelEvent-3">QWheelEvent</a></b>(const QPointF &amp;<i>pos</i>, const QPointF &amp;<i>globalPos</i>, QPoint <i>pixelDelta</i>, QPoint <i>angleDelta</i>, int <i>qt4Delta</i>, Qt::Orientation <i>qt4Orientation</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>, Qt::ScrollPhase <i>phase</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#QWheelEvent-4">QWheelEvent</a></b>(const QPointF &amp;<i>pos</i>, const QPointF &amp;<i>globalPos</i>, QPoint <i>pixelDelta</i>, QPoint <i>angleDelta</i>, int <i>qt4Delta</i>, Qt::Orientation <i>qt4Orientation</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>, Qt::ScrollPhase <i>phase</i>, Qt::MouseEventSource <i>source</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#QWheelEvent-5">QWheelEvent</a></b>(const QPointF &amp;<i>pos</i>, const QPointF &amp;<i>globalPos</i>, QPoint <i>pixelDelta</i>, QPoint <i>angleDelta</i>, int <i>qt4Delta</i>, Qt::Orientation <i>qt4Orientation</i>, Qt::MouseButtons <i>buttons</i>, Qt::KeyboardModifiers <i>modifiers</i>, Qt::ScrollPhase <i>phase</i>, Qt::MouseEventSource <i>source</i>, bool <i>inverted</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#angleDelta">angleDelta</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::MouseButtons </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#buttons">buttons</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#globalPos">globalPos</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QPointF &amp;</td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#globalPosF">globalPosF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#globalX">globalX</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#globalY">globalY</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#inverted">inverted</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::ScrollPhase </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#phase">phase</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#pixelDelta">pixelDelta</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#pos">pos</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QPointF &amp;</td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#posF">posF</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::MouseEventSource </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#source">source</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#x">x</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#y">y</a></b>() const</td></tr>
</table></div>
<ul>
<li class="fn">2 public functions inherited from <a href="qinputevent.html#public-functions">QInputEvent</a></li>
<li class="fn">6 public functions inherited from <a href="../qtcore/qevent.html#public-functions">QEvent</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qevent.html#properties">QEvent</a></li>
<li class="fn">1 static public member inherited from <a href="../qtcore/qevent.html#static-public-members">QEvent</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qevent.html#protected-variables">QEvent</a></li>
</ul>
<a name="details"></a>
<!-- $$$QWheelEvent-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qwheelevent.html">QWheelEvent</a> class contains parameters that describe a wheel event.</p>
<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. Wheel events are generated for both mouse wheels and trackpad scroll gestures. There are two ways to read the wheel event delta: <a href="qwheelevent.html#angleDelta">angleDelta</a>() returns the delta in wheel degrees. This value is always provided. <a href="qwheelevent.html#pixelDelta">pixelDelta</a>() returns the delta in screen pixels and is available on platforms that have high-resolution trackpads, such as macOS. If that is the case, <a href="qwheelevent.html#source">source</a>() will return <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSynthesizedBySystem</a>.</p>
<p>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>
<p>A wheel event contains a special accept flag that indicates whether the receiver wants the event. You should call <a href="../qtcore/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>
<p>The <a href="../qtwidgets/qwidget.html#enabled-prop">QWidget::setEnabled</a>() function can be used to enable or disable mouse and keyboard events for a widget.</p>
<p>The event handler <a href="../qtwidgets/qwidget.html#wheelEvent">QWidget::wheelEvent</a>() receives wheel events.</p>
</div>
<p><b>See also </b><a href="qmouseevent.html">QMouseEvent</a> and <a href="../qtwidgets/qwidget.html#grabMouse">QWidget::grabMouse</a>().</p>
<!-- @@@QWheelEvent -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QWheelEvent[overload1]$$$QWheelEventconstQPointF&constQPointF&QPointQPointintQt::OrientationQt::MouseButtonsQt::KeyboardModifiers -->
<h3 class="fn" id="QWheelEvent"><a name="QWheelEvent"></a>QWheelEvent::<span class="name">QWheelEvent</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>globalPos</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>pixelDelta</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>angleDelta</i>, <span class="type">int</span> <i>qt4Delta</i>, <span class="type"><a href="../qtcore/qt.html#Orientation-enum">Qt::Orientation</a></span> <i>qt4Orientation</i>, <span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>, <span class="type"><a href="../qtcore/qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> <i>modifiers</i>)</h3>
<p>Constructs a wheel event object.</p>
<p>The <i>pos</i> provides the location of the mouse cursor within the window. The position in global coordinates is specified by <i>globalPos</i>.</p>
<p><i>pixelDelta</i> contains the scrolling distance in pixels on screen, while <i>angleDelta</i> contains the wheel rotation distance. <i>pixelDelta</i> is optional and can be null.</p>
<p>The mouse and keyboard states at the time of the event are specified by <i>buttons</i> and <i>modifiers</i>.</p>
<p>For backwards compatibility, the event can also hold monodirectional wheel event data: <i>qt4Delta</i> specifies the rotation, and <i>qt4Orientation</i> the direction.</p>
<p>The <a href="qwheelevent.html#phase">phase</a>() is initialized to <a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollUpdate</a>. Use the other constructor to specify the phase explicitly.</p>
<p><b>See also </b><a href="qwheelevent.html#posF">posF</a>(), <a href="qwheelevent.html#globalPosF">globalPosF</a>(), <a href="qwheelevent.html#angleDelta">angleDelta</a>(), and <a href="qwheelevent.html#pixelDelta">pixelDelta</a>().</p>
<!-- @@@QWheelEvent -->
<!-- $$$QWheelEvent$$$QWheelEventconstQPointF&constQPointF&QPointQPointintQt::OrientationQt::MouseButtonsQt::KeyboardModifiersQt::ScrollPhase -->
<h3 class="fn" id="QWheelEvent-3"><a name="QWheelEvent-3"></a>QWheelEvent::<span class="name">QWheelEvent</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>globalPos</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>pixelDelta</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>angleDelta</i>, <span class="type">int</span> <i>qt4Delta</i>, <span class="type"><a href="../qtcore/qt.html#Orientation-enum">Qt::Orientation</a></span> <i>qt4Orientation</i>, <span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>, <span class="type"><a href="../qtcore/qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> <i>modifiers</i>, <span class="type"><a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollPhase</a></span> <i>phase</i>)</h3>
<p>Constructs a wheel event object.</p>
<p>The <i>pos</i> provides the location of the mouse cursor within the window. The position in global coordinates is specified by <i>globalPos</i>.</p>
<p><i>pixelDelta</i> contains the scrolling distance in pixels on screen, while <i>angleDelta</i> contains the wheel rotation distance. <i>pixelDelta</i> is optional and can be null.</p>
<p>The mouse and keyboard states at the time of the event are specified by <i>buttons</i> and <i>modifiers</i>.</p>
<p>For backwards compatibility, the event can also hold monodirectional wheel event data: <i>qt4Delta</i> specifies the rotation, and <i>qt4Orientation</i> the direction.</p>
<p>The scrolling phase of the event is specified by <i>phase</i>.</p>
<p><b>See also </b><a href="qwheelevent.html#posF">posF</a>(), <a href="qwheelevent.html#globalPosF">globalPosF</a>(), <a href="qwheelevent.html#angleDelta">angleDelta</a>(), <a href="qwheelevent.html#pixelDelta">pixelDelta</a>(), and <a href="qwheelevent.html#phase">phase</a>().</p>
<!-- @@@QWheelEvent -->
<!-- $$$QWheelEvent$$$QWheelEventconstQPointF&constQPointF&QPointQPointintQt::OrientationQt::MouseButtonsQt::KeyboardModifiersQt::ScrollPhaseQt::MouseEventSource -->
<h3 class="fn" id="QWheelEvent-4"><a name="QWheelEvent-4"></a>QWheelEvent::<span class="name">QWheelEvent</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>globalPos</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>pixelDelta</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>angleDelta</i>, <span class="type">int</span> <i>qt4Delta</i>, <span class="type"><a href="../qtcore/qt.html#Orientation-enum">Qt::Orientation</a></span> <i>qt4Orientation</i>, <span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>, <span class="type"><a href="../qtcore/qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> <i>modifiers</i>, <span class="type"><a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollPhase</a></span> <i>phase</i>, <span class="type"><a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSource</a></span> <i>source</i>)</h3>
<p>Constructs a wheel event object.</p>
<p>The <i>pos</i> provides the location of the mouse cursor within the window. The position in global coordinates is specified by <i>globalPos</i>.</p>
<p><i>pixelDelta</i> contains the scrolling distance in pixels on screen, while <i>angleDelta</i> contains the wheel rotation distance. <i>pixelDelta</i> is optional and can be null.</p>
<p>The mouse and keyboard states at the time of the event are specified by <i>buttons</i> and <i>modifiers</i>.</p>
<p>For backwards compatibility, the event can also hold monodirectional wheel event data: <i>qt4Delta</i> specifies the rotation, and <i>qt4Orientation</i> the direction.</p>
<p>The scrolling phase of the event is specified by <i>phase</i>.</p>
<p>If the wheel event comes from a physical mouse wheel, <i>source</i> is set to <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventNotSynthesized</a>. If it comes from a gesture detected by the operating system, or from a non-mouse hardware device, such that <i>pixelDelta</i> is directly related to finger movement, <i>source</i> is set to <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSynthesizedBySystem</a>. If it comes from Qt, source would be set to <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSynthesizedByQt</a>.</p>
<p><b>See also </b><a href="qwheelevent.html#posF">posF</a>(), <a href="qwheelevent.html#globalPosF">globalPosF</a>(), <a href="qwheelevent.html#angleDelta">angleDelta</a>(), <a href="qwheelevent.html#pixelDelta">pixelDelta</a>(), and <a href="qwheelevent.html#phase">phase</a>().</p>
<!-- @@@QWheelEvent -->
<!-- $$$QWheelEvent$$$QWheelEventconstQPointF&constQPointF&QPointQPointintQt::OrientationQt::MouseButtonsQt::KeyboardModifiersQt::ScrollPhaseQt::MouseEventSourcebool -->
<h3 class="fn" id="QWheelEvent-5"><a name="QWheelEvent-5"></a>QWheelEvent::<span class="name">QWheelEvent</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>, const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>globalPos</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>pixelDelta</i>, <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> <i>angleDelta</i>, <span class="type">int</span> <i>qt4Delta</i>, <span class="type"><a href="../qtcore/qt.html#Orientation-enum">Qt::Orientation</a></span> <i>qt4Orientation</i>, <span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>, <span class="type"><a href="../qtcore/qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> <i>modifiers</i>, <span class="type"><a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollPhase</a></span> <i>phase</i>, <span class="type"><a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSource</a></span> <i>source</i>, <span class="type">bool</span> <i>inverted</i>)</h3>
<p>Constructs a wheel event object.</p>
<p>The <i>pos</i> provides the location of the mouse cursor within the window. The position in global coordinates is specified by <i>globalPos</i>.</p>
<p><i>pixelDelta</i> contains the scrolling distance in pixels on screen, while <i>angleDelta</i> contains the wheel rotation distance. <i>pixelDelta</i> is optional and can be null.</p>
<p>The mouse and keyboard states at the time of the event are specified by <i>buttons</i> and <i>modifiers</i>.</p>
<p>For backwards compatibility, the event can also hold monodirectional wheel event data: <i>qt4Delta</i> specifies the rotation, and <i>qt4Orientation</i> the direction.</p>
<p>The scrolling phase of the event is specified by <i>phase</i>.</p>
<p>If the wheel event comes from a physical mouse wheel, <i>source</i> is set to <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventNotSynthesized</a>. If it comes from a gesture detected by the operating system, or from a non-mouse hardware device, such that <i>pixelDelta</i> is directly related to finger movement, <i>source</i> is set to <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSynthesizedBySystem</a>. If it comes from Qt, source would be set to <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSynthesizedByQt</a>.</p>
<p>If the system is configured to invert the delta values delivered with the event (such as natural scrolling of the touchpad on OS X), <i>inverted</i> should be <code>true</code>. Otherwise, <i>inverted</i> is <code>false</code></p>
<p><b>See also </b><a href="qwheelevent.html#posF">posF</a>(), <a href="qwheelevent.html#globalPosF">globalPosF</a>(), <a href="qwheelevent.html#angleDelta">angleDelta</a>(), <a href="qwheelevent.html#pixelDelta">pixelDelta</a>(), and <a href="qwheelevent.html#phase">phase</a>().</p>
<!-- @@@QWheelEvent -->
<!-- $$$angleDelta[overload1]$$$angleDelta -->
<h3 class="fn" id="angleDelta"><a name="angleDelta"></a><span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> QWheelEvent::<span class="name">angleDelta</span>() const</h3>
<p>Returns the distance that the wheel is rotated, in eighths of a degree. 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>
<p>Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e&#x2e;, 120 units * 1/8 = 15 degrees.</p>
<p>However, some mice have finer-resolution wheels and send delta values that are less than 120 units (less than 15 degrees). To support this possibility, you can either cumulatively add the delta values from events until the value of 120 is reached, then scroll the widget, or you can partially scroll the widget in response to each wheel event.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">void</span> MyWidget<span class="operator">::</span>wheelEvent(<span class="type"><a href="qwheelevent.html#QWheelEvent">QWheelEvent</a></span> <span class="operator">*</span>event)
  {
      <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> numPixels <span class="operator">=</span> event<span class="operator">-</span><span class="operator">&gt;</span>pixelDelta();
      <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> numDegrees <span class="operator">=</span> event<span class="operator">-</span><span class="operator">&gt;</span>angleDelta() <span class="operator">/</span> <span class="number">8</span>;

      <span class="keyword">if</span> (<span class="operator">!</span>numPixels<span class="operator">.</span>isNull()) {
          scrollWithPixels(numPixels);
      } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="operator">!</span>numDegrees<span class="operator">.</span>isNull()) {
          <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> numSteps <span class="operator">=</span> numDegrees <span class="operator">/</span> <span class="number">15</span>;
          scrollWithDegrees(numSteps);
      }

      event<span class="operator">-</span><span class="operator">&gt;</span>accept();
  }

</pre>
<p><b>Note: </b>On platforms that support scrolling <a href="qwheelevent.html#phase">phases</a>, the delta may be null when:</p><ul>
<li>scrolling is about to begin, but the distance did not yet change (<a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollBegin</a>),</li>
<li>or scrolling has ended and the distance did not change anymore (<a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollEnd</a>).</li>
</ul>
<!-- @@@angleDelta -->
<!-- $$$buttons[overload1]$$$buttons -->
<h3 class="fn" id="buttons"><a name="buttons"></a><span class="type"><a href="../qtcore/qt.html#MouseButton-enum">Qt::MouseButtons</a></span> QWheelEvent::<span class="name">buttons</span>() const</h3>
<p>Returns the mouse state when the event occurred.</p>
<!-- @@@buttons -->
<!-- $$$globalPos[overload1]$$$globalPos -->
<h3 class="fn" id="globalPos"><a name="globalPos"></a><span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> QWheelEvent::<span class="name">globalPos</span>() const</h3>
<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 X11; 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>
<p><b>See also </b><a href="qwheelevent.html#globalX">globalX</a>() and <a href="qwheelevent.html#globalY">globalY</a>().</p>
<!-- @@@globalPos -->
<!-- $$$globalPosF[overload1]$$$globalPosF -->
<h3 class="fn" id="globalPosF"><a name="globalPosF"></a>const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;QWheelEvent::<span class="name">globalPosF</span>() const</h3>
<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 X11; whenever you move your widgets around in response to mouse events, globalPosF() can differ a lot from the current cursor position returned by <a href="qcursor.html#pos">QCursor::pos</a>().</p>
<p><b>See also </b><a href="qwheelevent.html#posF">posF</a>().</p>
<!-- @@@globalPosF -->
<!-- $$$globalX[overload1]$$$globalX -->
<h3 class="fn" id="globalX"><a name="globalX"></a><span class="type">int</span> QWheelEvent::<span class="name">globalX</span>() const</h3>
<p>Returns the global x position of the mouse cursor at the time of the event.</p>
<p><b>See also </b><a href="qwheelevent.html#globalY">globalY</a>() and <a href="qwheelevent.html#globalPos">globalPos</a>().</p>
<!-- @@@globalX -->
<!-- $$$globalY[overload1]$$$globalY -->
<h3 class="fn" id="globalY"><a name="globalY"></a><span class="type">int</span> QWheelEvent::<span class="name">globalY</span>() const</h3>
<p>Returns the global y position of the mouse cursor at the time of the event.</p>
<p><b>See also </b><a href="qwheelevent.html#globalX">globalX</a>() and <a href="qwheelevent.html#globalPos">globalPos</a>().</p>
<!-- @@@globalY -->
<!-- $$$inverted[overload1]$$$inverted -->
<h3 class="fn" id="inverted"><a name="inverted"></a><span class="type">bool</span> QWheelEvent::<span class="name">inverted</span>() const</h3>
<p>Returns whether the delta values delivered with the event are inverted.</p>
<p>Normally, a vertical wheel will produce a <a href="qwheelevent.html">QWheelEvent</a> with positive delta values if the top of the wheel is rotating away from the hand operating it. Similarly, a horizontal wheel movement will produce a <a href="qwheelevent.html">QWheelEvent</a> with positive delta values if the top of the wheel is moved to the left.</p>
<p>However, on some platforms this is configurable, so that the same operations described above will produce negative delta values (but with the same magnitude). With the inverted property a wheel event consumer can choose to always follow the direction of the wheel, regardless of the system settings, but only for specific widgets. (One such use case could be that the user is rotating the wheel in the same direction as a visual Tumbler rotates. Another usecase is to make a slider handle follow the direction of movement of fingers on a touchpad regardless of system configuration.)</p>
<p><b>Note: </b>Many platforms provide no such information. On such platforms inverted always returns false.</p><p>This function was introduced in  Qt 5.7.</p>
<!-- @@@inverted -->
<!-- $$$phase[overload1]$$$phase -->
<h3 class="fn" id="phase"><a name="phase"></a><span class="type"><a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollPhase</a></span> QWheelEvent::<span class="name">phase</span>() const</h3>
<p>Returns the scrolling phase of this wheel event.</p>
<p><b>Note: </b>The <a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollBegin</a> and <a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollEnd</a> phases are currently supported only on macOS.</p><p>This function was introduced in  Qt 5.2.</p>
<!-- @@@phase -->
<!-- $$$pixelDelta[overload1]$$$pixelDelta -->
<h3 class="fn" id="pixelDelta"><a name="pixelDelta"></a><span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> QWheelEvent::<span class="name">pixelDelta</span>() const</h3>
<p>Returns the scrolling distance in pixels on screen. This value is provided on platforms that support high-resolution pixel-based delta values, such as macOS. The value should be used directly to scroll content on screen.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">void</span> MyWidget<span class="operator">::</span>wheelEvent(<span class="type"><a href="qwheelevent.html#QWheelEvent">QWheelEvent</a></span> <span class="operator">*</span>event)
  {
      <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> numPixels <span class="operator">=</span> event<span class="operator">-</span><span class="operator">&gt;</span>pixelDelta();
      <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> numDegrees <span class="operator">=</span> event<span class="operator">-</span><span class="operator">&gt;</span>angleDelta() <span class="operator">/</span> <span class="number">8</span>;

      <span class="keyword">if</span> (<span class="operator">!</span>numPixels<span class="operator">.</span>isNull()) {
          scrollWithPixels(numPixels);
      } <span class="keyword">else</span> <span class="keyword">if</span> (<span class="operator">!</span>numDegrees<span class="operator">.</span>isNull()) {
          <span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> numSteps <span class="operator">=</span> numDegrees <span class="operator">/</span> <span class="number">15</span>;
          scrollWithDegrees(numSteps);
      }

      event<span class="operator">-</span><span class="operator">&gt;</span>accept();
  }

</pre>
<p><b>Note: </b>On platforms that support scrolling <a href="qwheelevent.html#phase">phases</a>, the delta may be null when:</p><ul>
<li>scrolling is about to begin, but the distance did not yet change (<a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollBegin</a>),</li>
<li>or scrolling has ended and the distance did not change anymore (<a href="../qtcore/qt.html#ScrollPhase-enum">Qt::ScrollEnd</a>).</li>
</ul>
<!-- @@@pixelDelta -->
<!-- $$$pos[overload1]$$$pos -->
<h3 class="fn" id="pos"><a name="pos"></a><span class="type"><a href="../qtcore/qpoint.html">QPoint</a></span> QWheelEvent::<span class="name">pos</span>() const</h3>
<p>Returns the position of the mouse cursor relative to the widget that received the event.</p>
<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>
<p><b>See also </b><a href="qwheelevent.html#x">x</a>(), <a href="qwheelevent.html#y">y</a>(), and <a href="qwheelevent.html#globalPos">globalPos</a>().</p>
<!-- @@@pos -->
<!-- $$$posF[overload1]$$$posF -->
<h3 class="fn" id="posF"><a name="posF"></a>const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;QWheelEvent::<span class="name">posF</span>() const</h3>
<p>Returns the position of the mouse cursor relative to the widget that received the event.</p>
<p>If you move your widgets around in response to mouse events, use <a href="qwheelevent.html#globalPosF">globalPosF</a>() instead of this function.</p>
<p><b>See also </b><a href="qwheelevent.html#globalPosF">globalPosF</a>().</p>
<!-- @@@posF -->
<!-- $$$source[overload1]$$$source -->
<h3 class="fn" id="source"><a name="source"></a><span class="type"><a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSource</a></span> QWheelEvent::<span class="name">source</span>() const</h3>
<p>Returns information about the wheel event source.</p>
<p>The source can be used to distinguish between events that come from a mouse with a physical wheel and events that are generated by some other means, such as a flick gesture on a touchpad.</p>
<p><b>Note: </b>Many platforms provide no such information. On such platforms <a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventNotSynthesized</a> is returned always.</p><p>This function was introduced in  Qt 5.5.</p>
<p><b>See also </b><a href="../qtcore/qt.html#MouseEventSource-enum">Qt::MouseEventSource</a>.</p>
<!-- @@@source -->
<!-- $$$x[overload1]$$$x -->
<h3 class="fn" id="x"><a name="x"></a><span class="type">int</span> QWheelEvent::<span class="name">x</span>() const</h3>
<p>Returns the x position of the mouse cursor, relative to the widget that received the event.</p>
<p><b>See also </b><a href="qwheelevent.html#y">y</a>() and <a href="qwheelevent.html#pos">pos</a>().</p>
<!-- @@@x -->
<!-- $$$y[overload1]$$$y -->
<h3 class="fn" id="y"><a name="y"></a><span class="type">int</span> QWheelEvent::<span class="name">y</span>() const</h3>
<p>Returns the y position of the mouse cursor, relative to the widget that received the event.</p>
<p><b>See also </b><a href="qwheelevent.html#x">x</a>() and <a href="qwheelevent.html#pos">pos</a>().</p>
<!-- @@@y -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>