Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 6e2327ca1c896c6d674ae53117299f21 > files > 1096

qtdeclarative5-doc-5.12.6-1.mga7.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" />
<!-- qquickpinchhandler.cpp -->
  <title>PinchHandler QML Type | Qt Quick 5.12.6</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.12</td><td ><a href="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-qmlmodule.html">QML Types</a></td><td >PinchHandler QML Type</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtquick-index.html">Qt 5.12.6 Reference Documentation</a></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="#properties">Properties</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">PinchHandler QML Type</h1>
<span class="subtitle"></span>
<!-- $$$PinchHandler-brief -->
<p>Handler for pinch gestures. <a href="#details">More...</a></p>
<!-- @@@PinchHandler -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick 2.12</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtquick-multipointhandler.html">MultiPointHandler</a></p>
</td></tr></table></div><ul>
<li><a href="qml-qtquick-pinchhandler-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#active-prop">active</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#activeScale-prop">activeScale</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#centroid-prop">centroid</a></b></b> : QtQuick::HandlerPoint</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#maximumRotation-prop">maximumRotation</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#maximumScale-prop">maximumScale</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#minimumRotation-prop">minimumRotation</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#minimumScale-prop">minimumScale</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#minimumTouchPoints-prop">minimumTouchPoints</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#rotation-prop">rotation</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#scale-prop">scale</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#translation-prop">translation</a></b></b> : QVector2D</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#xAxis-prop">xAxis</a></b></b><ul>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#xAxis.minimum-prop">xAxis.minimum</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#xAxis.maximum-prop">xAxis.maximum</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#xAxis.enabled-prop">xAxis.enabled</a></b></b> : bool</li>
</ul>
</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#yAxis-prop">yAxis</a></b></b><ul>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#yAxis.minimum-prop">yAxis.minimum</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#yAxis.maximum-prop">yAxis.maximum</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-pinchhandler.html#yAxis.enabled-prop">yAxis.enabled</a></b></b> : bool</li>
</ul>
</li>
</ul>
<!-- $$$PinchHandler-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p><a href="qml-qtquick-pinchhandler.html">PinchHandler</a> is a handler that interprets a multi-finger gesture to interactively rotate, zoom, and drag an Item. Like other Input Handlers, by default it is fully functional, and manipulates its target, which is the Item within which it is declared.</p>
<pre class="qml">

  import QtQuick 2.12

  Rectangle {
      width: 400
      height: 300
      color: "lightsteelblue"
      PinchHandler { }
  }

</pre>
<p>It has properties to restrict the range of dragging, rotation, and zoom.</p>
<p>If it is declared within one Item but is assigned a different target, it handles events within the bounds of the outer Item but manipulates the <code>target</code> Item instead:</p>
<pre class="qml">

  import QtQuick 2.12

  Item {
      width: 640
      height: 480

      Rectangle {
          id: map
          color: "aqua"
          width: 400
          height: 300
      }

      PinchHandler {
          target: map
      }
  }

</pre>
<p>A third way to use it is to set target to <code>null</code> and react to property changes in some other way:</p>
<pre class="qml">

  import QtQuick 2.12

  Item {
      width: 640
      height: 480

      PinchHandler {
          id: handler
          target: null
      }

      Text {
          color: handler.active ? "darkgreen" : "black"
          text: handler.rotation.toFixed(1) + " degrees\n" +
                handler.translation.x.toFixed(1) + ", " + handler.translation.y.toFixed(1) + "\n" +
                (handler.scale * 100).toFixed(1) + "%"
      }
  }

</pre>
<p class="centerAlign"><img src="images/touchpoints-pinchhandler.png" alt="" /></p><p><b>See also </b><a href="qml-qtquick-pincharea.html">PinchArea</a>.</p>
<!-- @@@PinchHandler -->
<h2>Property Documentation</h2>
<!-- $$$active -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="active-prop">
<td class="tblQmlPropNode"><p>
<a name="active-prop"></a><span class="name">active</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property is true when all the constraints (epecially <a href="qml-qtquick-pinchhandler.html#minimumTouchPoints-prop">minimumTouchPoints</a>) are satisfied and the target, if any, is being manipulated.</p>
</div></div><!-- @@@active -->
<br/>
<!-- $$$activeScale -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="activeScale-prop">
<td class="tblQmlPropNode"><p>
<a name="activeScale-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">activeScale</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The scale factor while the pinch gesture is being performed. It is 1.0 when the gesture begins, increases as the touchpoints are spread apart, and decreases as the touchpoints are brought together. If target is not null, its <a href="qml-qtquick-item.html#scale-prop">scale</a> will be automatically multiplied by this value. Otherwise, bindings can be used to do arbitrary things with this value.</p>
</div></div><!-- @@@activeScale -->
<br/>
<!-- $$$centroid -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="centroid-prop">
<td class="tblQmlPropNode"><p>
<a name="centroid-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">centroid</span> : <span class="type"><a href="qml-qtquick-handlerpoint.html">QtQuick::HandlerPoint</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>A point exactly in the middle of the currently-pressed touch points. The target will be rotated around this point.</p>
</div></div><!-- @@@centroid -->
<br/>
<!-- $$$maximumRotation -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="maximumRotation-prop">
<td class="tblQmlPropNode"><p>
<a name="maximumRotation-prop"></a><span class="name">maximumRotation</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The maximum acceptable <a href="qml-qtquick-item.html#rotation-prop">rotation</a> to be applied to the target.</p>
</div></div><!-- @@@maximumRotation -->
<br/>
<!-- $$$maximumScale -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="maximumScale-prop">
<td class="tblQmlPropNode"><p>
<a name="maximumScale-prop"></a><span class="name">maximumScale</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The maximum acceptable <a href="qml-qtquick-item.html#scale-prop">scale</a> to be applied to the target.</p>
</div></div><!-- @@@maximumScale -->
<br/>
<!-- $$$minimumRotation -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="minimumRotation-prop">
<td class="tblQmlPropNode"><p>
<a name="minimumRotation-prop"></a><span class="name">minimumRotation</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The minimum acceptable <a href="qml-qtquick-item.html#rotation-prop">rotation</a> to be applied to the target.</p>
</div></div><!-- @@@minimumRotation -->
<br/>
<!-- $$$minimumScale -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="minimumScale-prop">
<td class="tblQmlPropNode"><p>
<a name="minimumScale-prop"></a><span class="name">minimumScale</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The minimum acceptable <a href="qml-qtquick-item.html#scale-prop">scale</a> to be applied to the target.</p>
</div></div><!-- @@@minimumScale -->
<br/>
<!-- $$$minimumTouchPoints -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="minimumTouchPoints-prop">
<td class="tblQmlPropNode"><p>
<a name="minimumTouchPoints-prop"></a><span class="name">minimumTouchPoints</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The pinch begins when this number of fingers are pressed. Until then, <a href="qml-qtquick-pinchhandler.html">PinchHandler</a> tracks the positions of any pressed fingers, but if it's an insufficient number, it does not scale or rotate its target, and the <a href="qml-qtquick-pinchhandler.html#active-prop">active</a> property will remain false.</p>
</div></div><!-- @@@minimumTouchPoints -->
<br/>
<!-- $$$rotation -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rotation-prop">
<td class="tblQmlPropNode"><p>
<a name="rotation-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">rotation</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The rotation of the pinch gesture in degrees, with positive values clockwise. It is 0 when the gesture begins. If target is not null, this will be automatically applied to its <a href="qml-qtquick-item.html#rotation-prop">rotation</a>. Otherwise, bindings can be used to do arbitrary things with this value.</p>
</div></div><!-- @@@rotation -->
<br/>
<!-- $$$scale -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="scale-prop">
<td class="tblQmlPropNode"><p>
<a name="scale-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">scale</span> : <span class="type">real</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The scale factor that will automatically be set on the target if it is not null. Otherwise, bindings can be used to do arbitrary things with this value. While the pinch gesture is being performed, it is continuously multiplied by <a href="qml-qtquick-pinchhandler.html#activeScale-prop">activeScale</a>; after the gesture ends, it stays the same; and when the next pinch gesture begins, it begins to be multiplied by <a href="qml-qtquick-pinchhandler.html#activeScale-prop">activeScale</a> again.</p>
</div></div><!-- @@@scale -->
<br/>
<!-- $$$translation -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="translation-prop">
<td class="tblQmlPropNode"><p>
<a name="translation-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">translation</span> : <span class="type">QVector2D</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The translation of the gesture <a href="qml-qtquick-pinchhandler.html#centroid-prop">centroid</a>. It is <code>(0, 0)</code> when the gesture begins.</p>
</div></div><!-- @@@translation -->
<br/>
<!-- $$$xAxis -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="even" id="xAxis-prop"><th class="centerAlign"><p><a name="xAxis-prop"></a><b>xAxis group</b></p></th></tr><tr valign="top" class="odd" id="xAxis.minimum-prop"><td class="tblQmlPropNode"><p><a name="xAxis.minimum-prop"></a><span class="name">xAxis.minimum</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="xAxis.maximum-prop"><td class="tblQmlPropNode"><p><a name="xAxis.maximum-prop"></a><span class="name">xAxis.maximum</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="xAxis.enabled-prop"><td class="tblQmlPropNode"><p><a name="xAxis.enabled-prop"></a><span class="name">xAxis.enabled</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p><code>xAxis</code> controls the constraints for horizontal translation of the target item.</p>
<p><code>minimum</code> is the minimum acceptable x coordinate of the translation. <code>maximum</code> is the maximum acceptable x coordinate of the translation. If <code>enabled</code> is true, horizontal dragging is allowed.</p>
</div></div><!-- @@@xAxis -->
<br/>
<!-- $$$yAxis -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="even" id="yAxis-prop"><th class="centerAlign"><p><a name="yAxis-prop"></a><b>yAxis group</b></p></th></tr><tr valign="top" class="odd" id="yAxis.minimum-prop"><td class="tblQmlPropNode"><p><a name="yAxis.minimum-prop"></a><span class="name">yAxis.minimum</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="yAxis.maximum-prop"><td class="tblQmlPropNode"><p><a name="yAxis.maximum-prop"></a><span class="name">yAxis.maximum</span> : <span class="type">real</span></p></td></tr><tr valign="top" class="odd" id="yAxis.enabled-prop"><td class="tblQmlPropNode"><p><a name="yAxis.enabled-prop"></a><span class="name">yAxis.enabled</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p><code>yAxis</code> controls the constraints for vertical translation of the target item.</p>
<p><code>minimum</code> is the minimum acceptable y coordinate of the translation. <code>maximum</code> is the maximum acceptable y coordinate of the translation. If <code>enabled</code> is true, vertical dragging is allowed.</p>
</div></div><!-- @@@yAxis -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>