Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 7055

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qevent.cpp -->
  <title>Qt 4.8: QWheelEvent Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QWheelEvent</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<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>
<h1 class="title">QWheelEvent Class Reference</h1>
<!-- $$$QWheelEvent-brief -->
<p>The QWheelEvent class contains parameters that describe a wheel event. <a href="#details">More...</a></p>
<!-- @@@QWheelEvent -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QWheelEvent&gt;</span></pre><p><b>Inherits: </b><a href="qinputevent.html">QInputEvent</a>.</p>
<ul>
<li><a href="qwheelevent-members.html">List of all members, including inherited members</a></li>
<li><a href="qwheelevent-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><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 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><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 )</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"> int </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#delta">delta</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QPoint &amp; </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#globalPos">globalPos</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"> Qt::Orientation </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#orientation">orientation</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QPoint &amp; </td><td class="memItemRight bottomAlign"><b><a href="qwheelevent.html#pos">pos</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>
<ul>
<li class="fn">1 public function inherited from <a href="qinputevent.html#public-functions">QInputEvent</a></li>
<li class="fn">6 public functions inherited from <a href="qevent.html#public-functions">QEvent</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 property inherited from <a href="qevent.html#properties">QEvent</a></li>
<li class="fn">1 static public member inherited from <a href="qevent.html#static-public-members">QEvent</a></li>
</ul>
<a name="details"></a>
<!-- $$$QWheelEvent-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QWheelEvent 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. 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>
<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>
<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>
<p>The event handler <a href="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="qwidget.html#grabMouse">QWidget::grabMouse</a>().</p>
<!-- @@@QWheelEvent -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QWheelEvent[overload1]$$$QWheelEventconstQPoint&intQt::MouseButtonsQt::KeyboardModifiersQt::Orientation -->
<h3 class="fn"><a name="QWheelEvent"></a>QWheelEvent::<span class="name">QWheelEvent</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>pos</i>, <span class="type">int</span> <i>delta</i>, <span class="type"><a href="qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>, <span class="type"><a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> <i>modifiers</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orient</i> = Qt::Vertical )</h3>
<p>Constructs a wheel event object.</p>
<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>
<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>
<p><b>See also </b><a href="qwheelevent.html#pos">pos</a>(), <a href="qwheelevent.html#delta">delta</a>(), and <a href="qwheelevent-qt3.html#state" class="compat">state</a>().</p>
<!-- @@@QWheelEvent -->
<!-- $$$QWheelEvent$$$QWheelEventconstQPoint&constQPoint&intQt::MouseButtonsQt::KeyboardModifiersQt::Orientation -->
<h3 class="fn"><a name="QWheelEvent-2"></a>QWheelEvent::<span class="name">QWheelEvent</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>pos</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>globalPos</i>, <span class="type">int</span> <i>delta</i>, <span class="type"><a href="qt.html#MouseButton-enum">Qt::MouseButtons</a></span> <i>buttons</i>, <span class="type"><a href="qt.html#KeyboardModifier-enum">Qt::KeyboardModifiers</a></span> <i>modifiers</i>, <span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> <i>orient</i> = Qt::Vertical )</h3>
<p>Constructs a wheel event object.</p>
<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>
<p><b>See also </b><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" class="compat">state</a>().</p>
<!-- @@@QWheelEvent -->
<!-- $$$buttons[overload1]$$$buttons -->
<h3 class="fn"><a name="buttons"></a><span class="type"><a href="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 -->
<!-- $$$delta[overload1]$$$delta -->
<h3 class="fn"><a name="delta"></a><span class="type">int</span> QWheelEvent::<span class="name">delta</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</a></span> <span class="operator">*</span>event)
 {
     <span class="type">int</span> numDegrees <span class="operator">=</span> event<span class="operator">-</span><span class="operator">&gt;</span>delta() <span class="operator">/</span> <span class="number">8</span>;
     <span class="type">int</span> numSteps <span class="operator">=</span> numDegrees <span class="operator">/</span> <span class="number">15</span>;

     <span class="keyword">if</span> (event<span class="operator">-</span><span class="operator">&gt;</span>orientation() <span class="operator">=</span><span class="operator">=</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>Horizontal) {
         scrollHorizontally(numSteps);
     } <span class="keyword">else</span> {
         scrollVertically(numSteps);
     }
     event<span class="operator">-</span><span class="operator">&gt;</span>accept();
 }</pre>
<!-- @@@delta -->
<!-- $$$globalPos[overload1]$$$globalPos -->
<h3 class="fn"><a name="globalPos"></a>const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; 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 -->
<!-- $$$globalX[overload1]$$$globalX -->
<h3 class="fn"><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"><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 -->
<!-- $$$orientation[overload1]$$$orientation -->
<h3 class="fn"><a name="orientation"></a><span class="type"><a href="qt.html#Orientation-enum">Qt::Orientation</a></span> QWheelEvent::<span class="name">orientation</span> () const</h3>
<p>Returns the wheel's orientation.</p>
<!-- @@@orientation -->
<!-- $$$pos[overload1]$$$pos -->
<h3 class="fn"><a name="pos"></a>const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; 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 -->
<!-- $$$x[overload1]$$$x -->
<h3 class="fn"><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"><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 class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      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. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>