<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qquickdroparea.cpp --> <title>DropArea QML Type | Qt Quick 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="qtquick-index.html">Qt Quick</a></td><td ><a href="qtquick-qmlmodule.html">QML Types</a></td><td >DropArea QML Type</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="#properties">Properties</a></li> <li class="level1"><a href="#signals">Signals</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">DropArea QML Type</h1> <span class="subtitle"></span> <!-- $$$DropArea-brief --> <p>For specifying drag and drop handling in an area <a href="#details">More...</a></p> <!-- @@@DropArea --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick 2.7</td></tr></table></div><ul> <li><a href="qml-qtquick-droparea-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-droparea.html#containsDrag-prop">containsDrag</a></b></b> : bool</li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#drag-prop">drag</a></b></b><ul> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#drag.x-prop">drag.x</a></b></b> : qreal</li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#drag.y-prop">drag.y</a></b></b> : qreal</li> </ul> </li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#drag.source-prop">drag.source</a></b></b> : Object</li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#keys-prop">keys</a></b></b> : stringlist</li> </ul> <a name="signals"></a> <h2 id="signals">Signals</h2> <ul> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#dropped-signal">dropped</a></b></b>(DragEvent <i>drop</i>)</li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#entered-signal">entered</a></b></b>(DragEvent <i>drag</i>)</li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#exited-signal">exited</a></b></b>()</li> <li class="fn"><b><b><a href="qml-qtquick-droparea.html#positionChanged-signal">positionChanged</a></b></b>(DragEvent <i>drag</i>)</li> </ul> <!-- $$$DropArea-description --> <a name="details"></a> <h2 id="details">Detailed Description</h2> <p>A <a href="qml-qtquick-droparea.html">DropArea</a> is an invisible item which receives events when other items are dragged over it.</p> <p>The <a href="qml-qtquick-drag.html">Drag</a> attached property can be used to notify the <a href="qml-qtquick-droparea.html">DropArea</a> when an Item is dragged over it.</p> <p>The <a href="qml-qtquick-droparea.html#keys-prop">keys</a> property can be used to filter drag events which don't include a matching key.</p> <p>The <a href="qml-qtquick-droparea.html#drag.source-prop">drag.source</a> property is communicated to the source of a drag event as the recipient of a drop on the drag target.</p> <p><b>See also </b><a href="qtquick-draganddrop-example.html">Qt Quick Examples - Drag and Drop</a> and <a href="qtquick-externaldraganddrop-example.html">Qt Quick Examples - externaldraganddrop</a>.</p> <!-- @@@DropArea --> <h2>Property Documentation</h2> <!-- $$$containsDrag --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="containsDrag-prop"> <td class="tblQmlPropNode"><p> <a name="containsDrag-prop"></a><span class="name">containsDrag</span> : <span class="type">bool</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property identifies whether the <a href="qml-qtquick-droparea.html">DropArea</a> currently contains any dragged items.</p> </div></div><!-- @@@containsDrag --> <br/> <!-- $$$drag --> <div class="qmlitem"><div class="qmlproto"><div class="table"><table class="qmlname"><tr valign="top" class="even" id="drag-prop"><th class="centerAlign"><p><a name="drag-prop"></a><b>drag group</b></p></th></tr><tr valign="top" class="odd" id="drag.x-prop"><td class="tblQmlPropNode"><p><a name="drag.x-prop"></a><span class="name">drag.x</span> : <span class="type">qreal</span></p></td></tr><tr valign="top" class="odd" id="drag.y-prop"><td class="tblQmlPropNode"><p><a name="drag.y-prop"></a><span class="name">drag.y</span> : <span class="type">qreal</span></p></td></tr></table></div></div><div class="qmldoc"><p>These properties hold the coordinates of the last drag event.</p> </div></div><!-- @@@drag --> <br/> <!-- $$$drag.source --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="drag.source-prop"> <td class="tblQmlPropNode"><p> <a name="drag.source-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 the source of a drag.</p> </div></div><!-- @@@drag.source --> <br/> <!-- $$$keys --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="keys-prop"> <td class="tblQmlPropNode"><p> <a name="keys-prop"></a><span class="name">keys</span> : <span class="type">stringlist</span></p></td></tr> </table></div> </div><div class="qmldoc"><p>This property holds a list of drag keys a <a href="qml-qtquick-droparea.html">DropArea</a> will accept.</p> <p>If no keys are listed the <a href="qml-qtquick-droparea.html">DropArea</a> will accept events from any drag source, otherwise the drag source must have at least one compatible key.</p> <p><b>See also </b><a href="qml-qtquick-drag.html#keys-attached-prop">QtQuick::Drag::keys</a>.</p> </div></div><!-- @@@keys --> <br/> <h2>Signal Documentation</h2> <!-- $$$dropped --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="dropped-signal"> <td class="tblQmlFuncNode"><p> <a name="dropped-signal"></a><span class="name">dropped</span>(<span class="type"><a href="qml-qtquick-dragevent.html">DragEvent</a></span> <i>drop</i>)</p></td></tr> </table></div> </div><div class="qmldoc"><p>This signal is emitted when a drop event occurs within the bounds of a <a href="qml-qtquick-droparea.html">DropArea</a>.</p> <p>The corresponding handler is <code>onDropped</code>.</p> </div></div><!-- @@@dropped --> <br/> <!-- $$$entered --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="entered-signal"> <td class="tblQmlFuncNode"><p> <a name="entered-signal"></a><span class="name">entered</span>(<span class="type"><a href="qml-qtquick-dragevent.html">DragEvent</a></span> <i>drag</i>)</p></td></tr> </table></div> </div><div class="qmldoc"><p>This signal is emitted when a <i>drag</i> enters the bounds of a <a href="qml-qtquick-droparea.html">DropArea</a>.</p> <p>The corresponding handler is <code>onEntered</code>.</p> </div></div><!-- @@@entered --> <br/> <!-- $$$exited --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="exited-signal"> <td class="tblQmlFuncNode"><p> <a name="exited-signal"></a><span class="name">exited</span>()</p></td></tr> </table></div> </div><div class="qmldoc"><p>This signal is emitted when a drag exits the bounds of a <a href="qml-qtquick-droparea.html">DropArea</a>.</p> <p>The corresponding handler is <code>onExited</code>.</p> </div></div><!-- @@@exited --> <br/> <!-- $$$positionChanged --> <div class="qmlitem"><div class="qmlproto"> <div class="table"><table class="qmlname"> <tr valign="top" class="odd" id="positionChanged-signal"> <td class="tblQmlFuncNode"><p> <a name="positionChanged-signal"></a><span class="name">positionChanged</span>(<span class="type"><a href="qml-qtquick-dragevent.html">DragEvent</a></span> <i>drag</i>)</p></td></tr> </table></div> </div><div class="qmldoc"><p>This signal is emitted when the position of a drag has changed.</p> <p>The corresponding handler is <code>onPositionChanged</code>.</p> </div></div><!-- @@@positionChanged --> <br/> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</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>