Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5346

qt-doc-4.8.5-10.fc18.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" />
<!-- qgesture.cpp -->
  <title>Qt 4.8: QGesture 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>QGesture</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-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#gesture-properties">Gesture Properties</a></li>
<li class="level2"><a href="#lifecycle-of-a-gesture-object">Lifecycle of a Gesture Object</a></li>
</ul>
</div>
<h1 class="title">QGesture Class Reference</h1>
<!-- $$$QGesture-brief -->
<p>The QGesture class represents a gesture, containing properties that describe the corresponding user input. <a href="#details">More...</a></p>
<!-- @@@QGesture -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QGesture&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p><b>Inherited by: </b><a href="qpangesture.html">QPanGesture</a>, <a href="qpinchgesture.html">QPinchGesture</a>, <a href="qswipegesture.html">QSwipeGesture</a>, <a href="qtapandholdgesture.html">QTapAndHoldGesture</a>, and <a href="qtapgesture.html">QTapGesture</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qgesture-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#GestureCancelPolicy-enum">GestureCancelPolicy</a></b> { CancelNone, CancelAllInContext }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qgesture.html#gestureCancelPolicy-prop">gestureCancelPolicy</a></b> : QGesture::GestureCancelPolicy</li>
<li class="fn"><b><a href="qgesture.html#gestureType-prop">gestureType</a></b> : const Qt::GestureType</li>
<li class="fn"><b><a href="qgesture.html#hasHotSpot-prop">hasHotSpot</a></b> : const bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qgesture.html#hotSpot-prop">hotSpot</a></b> : QPointF</li>
<li class="fn"><b><a href="qgesture.html#state-prop">state</a></b> : const Qt::GestureState</li>
</ul>
</td></tr>
</table>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</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="qgesture.html#QGesture">QGesture</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#dtor.QGesture">~QGesture</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> GestureCancelPolicy </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#gestureCancelPolicy-prop">gestureCancelPolicy</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::GestureType </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#gestureType-prop">gestureType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#hasHotSpot-prop">hasHotSpot</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPointF </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#hotSpot-prop">hotSpot</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#gestureCancelPolicy-prop">setGestureCancelPolicy</a></b> ( GestureCancelPolicy <i>policy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#hotSpot-prop">setHotSpot</a></b> ( const QPointF &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::GestureState </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#state-prop">state</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgesture.html#hotSpot-prop">unsetHotSpot</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGesture-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QGesture class represents a gesture, containing properties that describe the corresponding user input.</p>
<p>Gesture objects are not constructed directly by developers. They are created by the <a href="qgesturerecognizer.html">QGestureRecognizer</a> object that is registered with the application; see <a href="qgesturerecognizer.html#registerRecognizer">QGestureRecognizer::registerRecognizer</a>().</p>
<p>For an overview of gesture handling in Qt and information on using gestures in your applications, see the <a href="gestures-overview.html">Gestures Programming</a> document.</p>
<a name="gesture-properties"></a>
<h3>Gesture Properties</h3>
<p>The class has a list of properties that can be queried by the user to get some gesture-specific arguments. For example, the pinch gesture has a scale factor that is exposed as a property.</p>
<p>Developers of custom gesture recognizers can add additional properties in order to provide additional information about a gesture. This can be done by adding new dynamic properties to a QGesture object, or by subclassing the QGesture class (or one of its subclasses).</p>
<a name="lifecycle-of-a-gesture-object"></a>
<h3>Lifecycle of a Gesture Object</h3>
<p>A QGesture instance is implicitly created when needed and is owned by Qt. Developers should never destroy them or store them for later use as Qt may destroy particular instances of them and create new ones to replace them.</p>
<p>The registered gesture recognizer monitors the input events for the target object via its <a href="qgesturerecognizer.html#recognize">recognize()</a> function, updating the properties of the gesture object as required.</p>
<p>The gesture object may be delivered to the target object in a <a href="qgestureevent.html">QGestureEvent</a> if the corresponding gesture is active or has just been canceled. Each event that is delivered contains a list of gesture objects, since support for more than one gesture may be enabled for the target object. Due to the way events are handled in Qt, gesture events may be filtered by other objects.</p>
</div>
<p><b>See also </b><a href="qgestureevent.html">QGestureEvent</a> and <a href="qgesturerecognizer.html">QGestureRecognizer</a>.</p>
<!-- @@@QGesture -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$GestureCancelPolicy$$$CancelNone$$$CancelAllInContext -->
<h3 class="fn"><a name="GestureCancelPolicy-enum"></a>enum QGesture::<span class="name">GestureCancelPolicy</span></h3>
<p>This enum describes how accepting a gesture can cancel other gestures automatically.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QGesture::CancelNone</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">On accepting this gesture no other gestures will be affected.</td></tr>
<tr><td class="topAlign"><tt>QGesture::CancelAllInContext</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">On accepting this gesture all gestures that are active in the context (respecting the <a href="qt.html#GestureFlag-enum">Qt::GestureFlag</a> that were specified when subscribed to the gesture) will be cancelled.</td></tr>
</table>
<!-- @@@GestureCancelPolicy -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$gestureCancelPolicy-prop$$$gestureCancelPolicy$$$setGestureCancelPolicyGestureCancelPolicy -->
<h3 class="fn"><a name="gestureCancelPolicy-prop"></a><span class="name">gestureCancelPolicy</span> : <span class="type"><a href="qgesture.html#GestureCancelPolicy-enum">QGesture::GestureCancelPolicy</a></span></h3>
<p>This property holds the policy for deciding what happens on accepting a gesture.</p>
<p>On accepting one gesture Qt can automatically cancel other gestures that belong to other targets. The policy is normally set to not cancel any other gestures and can be set to cancel all active gestures in the context. For example for all child widgets.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> GestureCancelPolicy </td><td class="memItemRight bottomAlign"><span class="name"><b>gestureCancelPolicy</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setGestureCancelPolicy</b></span> ( GestureCancelPolicy <i>policy</i> )</td></tr>
</table>
<!-- @@@gestureCancelPolicy -->
<!-- $$$gestureType-prop$$$gestureType -->
<h3 class="fn"><a name="gestureType-prop"></a><span class="name">gestureType</span> : const <span class="type"><a href="qt.html#GestureType-enum">Qt::GestureType</a></span></h3>
<p>This property holds the type of the gesture.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::GestureType </td><td class="memItemRight bottomAlign"><span class="name"><b>gestureType</b></span> () const</td></tr>
</table>
<!-- @@@gestureType -->
<!-- $$$hasHotSpot-prop$$$hasHotSpot -->
<h3 class="fn"><a name="hasHotSpot-prop"></a><span class="name">hasHotSpot</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the gesture has a hot-spot.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>hasHotSpot</b></span> () const</td></tr>
</table>
<!-- @@@hasHotSpot -->
<!-- $$$hotSpot-prop$$$hotSpot$$$setHotSpotconstQPointF&$$$unsetHotSpot -->
<h3 class="fn"><a name="hotSpot-prop"></a><span class="name">hotSpot</span> : <span class="type"><a href="qpointf.html">QPointF</a></span></h3>
<p>This property holds the point that is used to find the receiver for the gesture event.</p>
<p>The hot-spot is a point in the global coordinate system, use <a href="qwidget.html#mapFromGlobal">QWidget::mapFromGlobal</a>() or <a href="qgestureevent.html#mapToGraphicsScene">QGestureEvent::mapToGraphicsScene</a>() to get a local hot-spot.</p>
<p>The hot-spot should be set by the gesture recognizer to allow gesture event delivery to a <a href="qgraphicsobject.html">QGraphicsObject</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QPointF </td><td class="memItemRight bottomAlign"><span class="name"><b>hotSpot</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setHotSpot</b></span> ( const QPointF &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>unsetHotSpot</b></span> ()</td></tr>
</table>
<!-- @@@hotSpot -->
<!-- $$$state-prop$$$state -->
<h3 class="fn"><a name="state-prop"></a><span class="name">state</span> : const <span class="type"><a href="qt.html#GestureState-enum">Qt::GestureState</a></span></h3>
<p>This property holds the current state of the gesture.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::GestureState </td><td class="memItemRight bottomAlign"><span class="name"><b>state</b></span> () const</td></tr>
</table>
<!-- @@@state -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGesture[overload1]$$$QGestureQObject* -->
<h3 class="fn"><a name="QGesture"></a>QGesture::<span class="name">QGesture</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a new gesture object with the given <i>parent</i>.</p>
<p><a href="qgesture.html">QGesture</a> objects are created by gesture recognizers in the <a href="qgesturerecognizer.html#create">QGestureRecognizer::create</a>() function.</p>
<!-- @@@QGesture -->
<!-- $$$~QGesture[overload1]$$$~QGesture -->
<h3 class="fn"><a name="dtor.QGesture"></a>QGesture::<span class="name">~QGesture</span> ()</h3>
<p>Destroys the gesture object.</p>
<!-- @@@~QGesture -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. 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>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      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>