1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
|
<?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/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<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>
<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 <QGesture></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 & <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 & <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 class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation 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>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
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>
</body>
</html>
|