/usr/share/qt5/doc/qtquick/qml-qtquick-drag.html is in qtdeclarative5-doc-html 5.5.1-2ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickdrag.cpp -->
<title>Drag QML Type | Qt Quick 5.5</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.5</li>
<li><a href="qtquick-index.html">Qt Quick</a></li>
<li><a href="qtquick-qmlmodule.html">QML Types</a></li>
<li>Drag QML Type</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</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">Attached Properties</a></li>
<li class="level1"><a href="#signals">Attached Signals</a></li>
<li class="level1"><a href="#methods">Attached Methods</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">Drag QML Type</h1>
<span class="subtitle"></span>
<!-- $$$Drag-brief -->
<p>For specifying drag and drop events for moved Items <a href="#details">More...</a></p>
<!-- @@@Drag -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick 2.5</td></tr></table></div><ul>
<li><a href="qml-qtquick-drag-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="attached-properties"></a>
<h2 id="attached-properties">Attached Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#active-attached-prop">active</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#dragType-attached-prop">dragType</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#hotSpot-attached-prop">hotSpot</a></b></b> : QPointF</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#keys-attached-prop">keys</a></b></b> : stringlist</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#mimeData-attached-prop">mimeData</a></b></b> : stringlist</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#proposedAction-attached-prop">proposedAction</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#source-attached-prop">source</a></b></b> : Object</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#supportedActions-attached-prop">supportedActions</a></b></b> : flags</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#target-attached-prop">target</a></b></b> : Object</li>
</ul>
<a name="attached-signals"></a>
<h2 id="attached-signals">Attached Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#dragFinished-signal">dragFinished</a></b></b>(DropAction <i> action</i>)</li>
<li class="fn"><b><b><a href="qml-qtquick-drag.html#dragStarted-signal">dragStarted</a></b></b>()</li>
</ul>
<a name="attached-methods"></a>
<h2 id="attached-methods">Attached Methods</h2>
<ul>
<li class="fn">void <b><b><a href="qml-qtquick-drag.html#cancel-method">cancel</a></b></b>()</li>
<li class="fn">enumeration <b><b><a href="qml-qtquick-drag.html#drop-method">drop</a></b></b>()</li>
<li class="fn">void <b><b><a href="qml-qtquick-drag.html#start-method">start</a></b></b>(flags <i> supportedActions</i>)</li>
<li class="fn">void <b><b><a href="qml-qtquick-drag.html#startDrag-method">startDrag</a></b></b>(flags <i> supportedActions</i>)</li>
</ul>
<!-- $$$Drag-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
</p>
<p>Using the Drag attached property, any Item can be made a source of drag and drop events within a scene.</p>
<p>When a drag is <a href="qml-qtquick-drag.html#active-attached-prop">active</a> on an item, any change in that item's position will generate a drag event that will be sent to any <a href="qml-qtquick-droparea.html">DropArea</a> that intersects with the new position of the item. Other items which implement drag and drop event handlers can also receive these events.</p>
<p>The following snippet shows how an item can be dragged with a <a href="qml-qtquick-mousearea.html">MouseArea</a>. However, dragging is not limited to mouse drags; anything that can move an item can generate drag events, including touch events, animations and bindings.</p>
<pre class="qml">import QtQuick 2.0
<span class="type"><a href="qml-qtquick-item.html">Item</a></span> {
<span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span>
<span class="type"><a href="qml-qtquick-droparea.html">DropArea</a></span> {
<span class="name">x</span>: <span class="number">75</span>; <span class="name">y</span>: <span class="number">75</span>
<span class="name">width</span>: <span class="number">50</span>; <span class="name">height</span>: <span class="number">50</span>
<span class="type"><a href="qml-qtquick-rectangle.html">Rectangle</a></span> {
<span class="name">anchors</span>.fill: <span class="name">parent</span>
<span class="name">color</span>: <span class="string">"green"</span>
<span class="name">visible</span>: <span class="name">parent</span>.<span class="name">containsDrag</span>
}
}
<span class="type"><a href="qml-qtquick-rectangle.html">Rectangle</a></span> {
<span class="name">x</span>: <span class="number">10</span>; <span class="name">y</span>: <span class="number">10</span>
<span class="name">width</span>: <span class="number">20</span>; <span class="name">height</span>: <span class="number">20</span>
<span class="name">color</span>: <span class="string">"red"</span>
<span class="name">Drag</span>.active: <span class="name">dragArea</span>.<span class="name">drag</span>.<span class="name">active</span>
<span class="name">Drag</span>.hotSpot.x: <span class="number">10</span>
<span class="name">Drag</span>.hotSpot.y: <span class="number">10</span>
<span class="type"><a href="qml-qtquick-mousearea.html">MouseArea</a></span> {
<span class="name">id</span>: <span class="name">dragArea</span>
<span class="name">anchors</span>.fill: <span class="name">parent</span>
<span class="name">drag</span>.target: <span class="name">parent</span>
}
}
}</pre>
<p>A drag can be terminated either by canceling it with Drag.<a href="qml-qtquick-drag.html#cancel-method">cancel()</a> or setting Drag.active to false, or it can be terminated with a drop event by calling Drag.<a href="qml-qtquick-drag.html#drop-method">drop()</a>. If the drop event is accepted, Drag.<a href="qml-qtquick-drag.html#drop-method">drop()</a> will return the <a href="qml-qtquick-drag.html#supportedActions-attached-prop">drop action</a> chosen by the recipient of the event, otherwise it will return Qt.IgnoreAction.</p>
<!-- @@@Drag -->
<h2>Attached Property Documentation</h2>
<!-- $$$active -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="active-attached-prop"><td class="tblQmlPropNode"><p><a name="active-attached-prop"></a><span class="name">Drag.active</span> : <span class="type">bool</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds whether a drag event sequence is currently active.</p>
<p>Binding this property to the active property of <a href="qml-qtquick-mousearea.html#drag-prop">MouseArea::drag</a> will cause <a href="qml-qtquick-drag.html#startDrag-method">startDrag</a> to be called when the user starts dragging.</p>
<p>Setting this property to true will also send a QDragEnter event to the scene with the item's current position. Setting it to false will send a QDragLeave event.</p>
<p>While a drag is active any change in an item's position will send a QDragMove event with item's new position to the scene.</p>
</div></div><!-- @@@active -->
<br/>
<!-- $$$dragType -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="dragType-attached-prop"><td class="tblQmlPropNode"><p><a name="dragType-attached-prop"></a><span class="name">Drag.dragType</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property indicates whether to automatically start drags, do nothing, or to use backwards compatible internal drags. The default is to use backwards compatible internal drags.</p>
<p>A drag can also be started manually using <a href="qml-qtquick-drag.html#startDrag-method">startDrag</a>.</p>
<ul>
<li>Drag.None - do not start drags automatically</li>
<li>Drag.Automatic - start drags automatically</li>
<li>Drag.Internal (default) - start backwards compatible drags automatically</li>
</ul>
<p>When using <code>Drag.Automatic</code> you should also define <a href="qml-qtquick-drag.html#mimeData-attached-prop">mimeData</a> and bind the <a href="qml-qtquick-drag.html#active-attached-prop">active</a> property to the active property of <a href="qml-qtquick-mousearea.html">MouseArea</a> : <a href="qml-qtquick-mousearea.html#drag.active-prop">MouseArea::drag.active</a></p>
<p>This QML property was introduced in Qt 5.2.</p>
</div></div><!-- @@@dragType -->
<br/>
<!-- $$$hotSpot -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="hotSpot-attached-prop"><td class="tblQmlPropNode"><p><a name="hotSpot-attached-prop"></a><span class="name">Drag.hotSpot</span> : <span class="type">QPointF</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds the drag position relative to the top left of the item.</p>
<p>By default this is (0, 0).</p>
<p>Changes to hotSpot trigger a new drag move with the updated position.</p>
</div></div><!-- @@@hotSpot -->
<br/>
<!-- $$$keys -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="keys-attached-prop"><td class="tblQmlPropNode"><p><a name="keys-attached-prop"></a><span class="name">Drag.keys</span> : <span class="type">stringlist</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds a list of keys that can be used by a <a href="qml-qtquick-droparea.html">DropArea</a> to filter drag events.</p>
<p>Changing the keys while a drag is active will reset the sequence of drag events by sending a drag leave event followed by a drag enter event with the new source.</p>
</div></div><!-- @@@keys -->
<br/>
<!-- $$$mimeData -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="mimeData-attached-prop"><td class="tblQmlPropNode"><p><a name="mimeData-attached-prop"></a><span class="name">Drag.mimeData</span> : <span class="type">stringlist</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds a map of mimeData that is used during <a href="qml-qtquick-drag.html#startDrag-method">startDrag</a>.</p>
<p>This QML property was introduced in Qt 5.2.</p>
</div></div><!-- @@@mimeData -->
<br/>
<!-- $$$proposedAction -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="proposedAction-attached-prop"><td class="tblQmlPropNode"><p><a name="proposedAction-attached-prop"></a><span class="name">Drag.proposedAction</span> : <span class="type">enumeration</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds an action that is recommended by the drag source as a return value from Drag.<a href="qml-qtquick-drag.html#drop-method">drop()</a>.</p>
<p>Changes to proposedAction will trigger a move event with the updated proposal.</p>
</div></div><!-- @@@proposedAction -->
<br/>
<!-- $$$source -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="source-attached-prop"><td class="tblQmlPropNode"><p><a name="source-attached-prop"></a><span class="name">Drag.source</span> : <span class="type">Object</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds an object that is identified to recipients of drag events as the source of the events. By default this is the item that the Drag property is attached to.</p>
<p>Changing the source while a drag is active will reset the sequence of drag events by sending a drag leave event followed by a drag enter event with the new source.</p>
</div></div><!-- @@@source -->
<br/>
<!-- $$$supportedActions -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="supportedActions-attached-prop"><td class="tblQmlPropNode"><p><a name="supportedActions-attached-prop"></a><span class="name">Drag.supportedActions</span> : <span class="type">flags</span></p></td></tr></table></div></div><div class="qmldoc"><p>This property holds return values of Drag.<a href="qml-qtquick-drag.html#drop-method">drop()</a> supported by the drag source.</p>
<p>Changing the supportedActions while a drag is active will reset the sequence of drag events by sending a drag leave event followed by a drag enter event with the new source.</p>
</div></div><!-- @@@supportedActions -->
<br/>
<!-- $$$target -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="target-attached-prop"><td class="tblQmlPropNode"><p><a name="target-attached-prop"></a><span class="name">Drag.target</span> : <span class="type">Object</span></p></td></tr></table></div></div><div class="qmldoc"><p>While a drag is active this property holds the last object to accept an enter event from the dragged item, if the current drag position doesn't intersect any accepting targets it is null.</p>
<p>When a drag is not active this property holds the object that accepted the drop event that ended the drag, if no object accepted the drop or the drag was canceled the target will then be null.</p>
</div></div><!-- @@@target -->
<br/>
<h2>Attached Signal Documentation</h2>
<!-- $$$dragFinished -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="dragFinished-signal"><td class="tblQmlFuncNode"><p><a name="dragFinished-signal"></a><span class="name">dragFinished</span>(<span class="type">DropAction</span><i> action</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>This signal is emitted when a drag finishes and the drag was started with the <a href="qml-qtquick-drag.html#startDrag-method">startDrag()</a> method or started automatically using the <a href="qml-qtquick-drag.html#dragType-attached-prop">dragType</a> property.</p>
<p>The corresponding handler is <code>onDragFinished</code>.</p>
</div></div><!-- @@@dragFinished -->
<br/>
<!-- $$$dragStarted -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="dragStarted-signal"><td class="tblQmlFuncNode"><p><a name="dragStarted-signal"></a><span class="name">dragStarted</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>This signal is emitted when a drag is started with the <a href="qml-qtquick-drag.html#startDrag-method">startDrag()</a> method or when it is started automatically using the <a href="qml-qtquick-drag.html#dragType-attached-prop">dragType</a> property.</p>
<p>The corresponding handler is <code>onDragStarted</code>.</p>
</div></div><!-- @@@dragStarted -->
<br/>
<h2>Attached Method Documentation</h2>
<!-- $$$cancel -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="cancel-method"><td class="tblQmlFuncNode"><p><a name="cancel-method"></a><span class="type">void</span> <span class="name">cancel</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Ends a drag sequence.</p>
</div></div><!-- @@@cancel -->
<br/>
<!-- $$$drop -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="drop-method"><td class="tblQmlFuncNode"><p><a name="drop-method"></a><span class="type">enumeration</span> <span class="name">drop</span>()</p></td></tr></table></div></div><div class="qmldoc"><p>Ends a drag sequence by sending a drop event to the target item.</p>
<p>Returns the action accepted by the target item. If the target item or a parent doesn't accept the drop event then Qt.IgnoreAction will be returned.</p>
<p>The returned drop action may be one of:</p>
<ul>
<li>Qt.CopyAction Copy the data to the target</li>
<li>Qt.MoveAction Move the data from the source to the target</li>
<li>Qt.LinkAction Create a link from the source to the target.</li>
<li>Qt.IgnoreAction Ignore the action (do nothing with the data).</li>
</ul>
</div></div><!-- @@@drop -->
<br/>
<!-- $$$start -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="start-method"><td class="tblQmlFuncNode"><p><a name="start-method"></a><span class="type">void</span> <span class="name">start</span>(<span class="type">flags</span><i> supportedActions</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Starts sending drag events. Used for starting old-style internal drags. <a href="qml-qtquick-drag.html#startDrag-method">startDrag</a> is the new-style, preferred method of starting drags.</p>
<p>The optional <i>supportedActions</i> argument can be used to override the <a href="qml-qtquick-drag.html#supportedActions-attached-prop">supportedActions</a> property for the started sequence.</p>
</div></div><!-- @@@start -->
<br/>
<!-- $$$startDrag -->
<div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="odd" id="startDrag-method"><td class="tblQmlFuncNode"><p><a name="startDrag-method"></a><span class="type">void</span> <span class="name">startDrag</span>(<span class="type">flags</span><i> supportedActions</i>)</p></td></tr></table></div></div><div class="qmldoc"><p>Starts sending drag events.</p>
<p>The optional <i>supportedActions</i> argument can be used to override the <a href="qml-qtquick-drag.html#supportedActions-attached-prop">supportedActions</a> property for the started sequence.</p>
</div></div><!-- @@@startDrag -->
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2015 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>
|