Sophie

Sophie

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

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" />
<!-- qgesture.cpp -->
  <title>QGesture Class | Qt Widgets 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="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QGesture</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-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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGesture Class</h1>
<!-- $$$QGesture-brief -->
<p>The <a href="qgesture.html">QGesture</a> class represents a gesture, containing properties that describe the corresponding user input. <a href="#details">More...</a></p>
<!-- @@@QGesture -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGesture&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.6</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="../qtcore/qobject.html">QObject</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><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>
</td></tr></table></div><ul>
<li><a href="qgesture-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><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></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><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></div>
<ul>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</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="qgesture.html#QGesture">QGesture</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</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></div>
<ul>
<li class="fn">32 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
<li class="fn">1 public variable inherited from <a href="../qtcore/qobject.html#public-variables">QObject</a></li>
<li class="fn">10 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">2 protected variables inherited from <a href="../qtcore/qobject.html#protected-variables">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGesture-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qgesture.html">QGesture</a> 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 in Widgets and Graphics View</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 <a href="qgesture.html">QGesture</a> object, or by subclassing the <a href="qgesture.html">QGesture</a> class (or one of its subclasses).</p>
<a name="lifecycle-of-a-gesture-object"></a>
<h3 >Lifecycle of a Gesture Object</h3>
<p>A <a href="qgesture.html">QGesture</a> 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" id="GestureCancelPolicy-enum"><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>
<div class="table"><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"><code>QGesture::CancelNone</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">On accepting this gesture no other gestures will be affected.</td></tr>
<tr><td class="topAlign"><code>QGesture::CancelAllInContext</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">On accepting this gesture all gestures that are active in the context (respecting the <a href="../qtcore/qt.html#GestureFlag-enum">Qt::GestureFlag</a> that were specified when subscribed to the gesture) will be cancelled.</td></tr>
</table></div>
<!-- @@@GestureCancelPolicy -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$gestureCancelPolicy-prop$$$gestureCancelPolicy$$$setGestureCancelPolicyGestureCancelPolicy -->
<h3 class="fn" id="gestureCancelPolicy-prop"><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>
<div class="table"><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></div>
<!-- @@@gestureCancelPolicy -->
<!-- $$$gestureType-prop$$$gestureType -->
<h3 class="fn" id="gestureType-prop"><a name="gestureType-prop"></a><span class="name">gestureType</span> : const <span class="type"><a href="../qtcore/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>
<div class="table"><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></div>
<!-- @@@gestureType -->
<!-- $$$hasHotSpot-prop$$$hasHotSpot -->
<h3 class="fn" id="hasHotSpot-prop"><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>
<div class="table"><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></div>
<!-- @@@hasHotSpot -->
<!-- $$$hotSpot-prop$$$hotSpot$$$setHotSpotconstQPointF&$$$unsetHotSpot -->
<h3 class="fn" id="hotSpot-prop"><a name="hotSpot-prop"></a><span class="name">hotSpot</span> : <span class="type"><a href="../qtcore/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>
<div class="table"><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></div>
<!-- @@@hotSpot -->
<!-- $$$state-prop$$$state -->
<h3 class="fn" id="state-prop"><a name="state-prop"></a><span class="name">state</span> : const <span class="type"><a href="../qtcore/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>
<div class="table"><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></div>
<!-- @@@state -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGesture[overload1]$$$QGestureQObject* -->
<h3 class="fn" id="QGesture"><a name="QGesture"></a>QGesture::<span class="name">QGesture</span>(<span class="type"><a href="../qtcore/qobject.html#QObject">QObject</a></span> *<i>parent</i> = Q_NULLPTR)</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" id="dtor.QGesture"><a name="dtor.QGesture"></a>QGesture::<span class="name">~QGesture</span>()</h3>
<p>Destroys the gesture object.</p>
<!-- @@@~QGesture -->
</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>