<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QDropEvent Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDropEvent Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDropEvent class provides an event which is sent when a drag and drop action is completed. <a href="#details">More...</a></p> <p>Inherits <a href="qevent.html">QEvent</a> and <a href="qmimesource.html">QMimeSource</a>.</p><p>Inherited by <a href="qdragmoveevent.html">QDragMoveEvent</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdropevent.html#QDropEvent">__init__</a></b> (<i>self</i>, QPoint <i>pos</i>, Qt.DropActions <i>actions</i>, QMimeData <i>data</i>, Qt.MouseButtons <i>buttons</i>, Qt.KeyboardModifiers <i>modifiers</i>, QEvent.Type <i>type</i> = QEvent.Drop)</li><li><div class="fn" /><b><a href="qdropevent.html#QDropEvent-2">__init__</a></b> (<i>self</i>, QDropEvent)</li><li><div class="fn" /><b><a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropAction <b><a href="qdropevent.html#dropAction">dropAction</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qdropevent.html#encodedData">encodedData</a></b> (<i>self</i>, str)</li><li><div class="fn" />str <b><a href="qdropevent.html#format">format</a></b> (<i>self</i>, int <i>n</i> = 0)</li><li><div class="fn" />Qt.KeyboardModifiers <b><a href="qdropevent.html#keyboardModifiers">keyboardModifiers</a></b> (<i>self</i>)</li><li><div class="fn" />QMimeData <b><a href="qdropevent.html#mimeData">mimeData</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.MouseButtons <b><a href="qdropevent.html#mouseButtons">mouseButtons</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qdropevent.html#pos">pos</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qdropevent.html#possibleActions">possibleActions</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropAction <b><a href="qdropevent.html#proposedAction">proposedAction</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdropevent.html#provides">provides</a></b> (<i>self</i>, str)</li><li><div class="fn" /><b><a href="qdropevent.html#setDropAction">setDropAction</a></b> (<i>self</i>, Qt.DropAction <i>action</i>)</li><li><div class="fn" />QWidget <b><a href="qdropevent.html#source">source</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDropEvent class provides an event which is sent when a drag and drop action is completed.</p> <p>When a widget <a href="qwidget.html#acceptDrops-prop">accepts drop events</a>, it will receive this event if it has accepted the most recent <a href="qdragenterevent.html">QDragEnterEvent</a> or <a href="qdragmoveevent.html">QDragMoveEvent</a> sent to it.</p> <p>The drop event contains a proposed action, available from <a href="qdropevent.html#proposedAction">proposedAction</a>(), for the widget to either accept or ignore. If the action can be handled by the widget, you should call the <a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a>() function. Since the proposed action can be a combination of <a href="qt.html#DropAction-enum">Qt.DropAction</a> values, it may be useful to either select one of these values as a default action or ask the user to select their preferred action.</p> <p>If the proposed drop action is not suitable, perhaps because your custom widget does not support that action, you can replace it with any of the <a href="qdropevent.html#possibleActions">possible drop actions</a> by calling <a href="qdropevent.html#setDropAction">setDropAction</a>() with your preferred action. If you set a value that is not present in the bitwise OR combination of values returned by <a href="qdropevent.html#possibleActions">possibleActions</a>(), the default copy action will be used. Once a replacement drop action has been set, call accept() instead of <a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a>() to complete the drop operation.</p> <p>The <a href="qdropevent.html#mimeData">mimeData</a>() function provides the data dropped on the widget in a <a href="qmimedata.html">QMimeData</a> object. This contains information about the MIME type of the data in addition to the data itself.</p> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDropEvent" />QDropEvent.__init__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>pos</i>, <a href="qt-dropactions.html">Qt.DropActions</a> <i>actions</i>, <a href="qmimedata.html">QMimeData</a> <i>data</i>, <a href="qt-mousebuttons.html">Qt.MouseButtons</a> <i>buttons</i>, <a href="qt-keyboardmodifiers.html">Qt.KeyboardModifiers</a> <i>modifiers</i>, <a href="qevent.html#Type-enum">QEvent.Type</a> <i>type</i> = QEvent.Drop)</h3><p>Constructs a drop event of a certain <i>type</i> corresponding to a drop at the point specified by <i>pos</i> in the destination widget's coordinate system.</p> <p>The <i>actions</i> indicate which types of drag and drop operation can be performed, and the drag data is stored as MIME-encoded data in <i>data</i>.</p> <p>The states of the mouse buttons and keyboard modifiers at the time of the drop are specified by <i>buttons</i> and <i>modifiers</i>.</p> <h3 class="fn"><a name="QDropEvent-2" />QDropEvent.__init__ (<i>self</i>, <a href="qdropevent.html">QDropEvent</a>)</h3><h3 class="fn"><a name="acceptProposedAction" />QDropEvent.acceptProposedAction (<i>self</i>)</h3><p>Sets the drop action to be the proposed action.</p> <p><b>See also</b> <a href="qdropevent.html#setDropAction">setDropAction</a>(), <a href="qdropevent.html#proposedAction">proposedAction</a>(), and <a href="qevent.html#accept">accept</a>().</p> <h3 class="fn"><a name="dropAction" /><a href="qt.html#DropAction-enum">Qt.DropAction</a> QDropEvent.dropAction (<i>self</i>)</h3><p>Returns the action to be performed on the data by the target. This may be different from the action supplied in <a href="qdropevent.html#proposedAction">proposedAction</a>() if you have called <a href="qdropevent.html#setDropAction">setDropAction</a>() to explicitly choose a drop action.</p> <p><b>See also</b> <a href="qdropevent.html#setDropAction">setDropAction</a>().</p> <h3 class="fn"><a name="encodedData" /><a href="qbytearray.html">QByteArray</a> QDropEvent.encodedData (<i>self</i>, str)</h3><h3 class="fn"><a name="format" />str QDropEvent.format (<i>self</i>, int <i>n</i> = 0)</h3><h3 class="fn"><a name="keyboardModifiers" /><a href="qt-keyboardmodifiers.html">Qt.KeyboardModifiers</a> QDropEvent.keyboardModifiers (<i>self</i>)</h3><p>Returns the modifier keys that are pressed.</p> <h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QDropEvent.mimeData (<i>self</i>)</h3><p>Returns the data that was dropped on the widget and its associated MIME type information.</p> <h3 class="fn"><a name="mouseButtons" /><a href="qt-mousebuttons.html">Qt.MouseButtons</a> QDropEvent.mouseButtons (<i>self</i>)</h3><p>Returns the mouse buttons that are pressed..</p> <h3 class="fn"><a name="pos" /><a href="qpoint.html">QPoint</a> QDropEvent.pos (<i>self</i>)</h3><p>Returns the position where the drop was made.</p> <h3 class="fn"><a name="possibleActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QDropEvent.possibleActions (<i>self</i>)</h3><p>Returns an OR-combination of possible drop actions.</p> <p><b>See also</b> <a href="qdropevent.html#dropAction">dropAction</a>().</p> <h3 class="fn"><a name="proposedAction" /><a href="qt.html#DropAction-enum">Qt.DropAction</a> QDropEvent.proposedAction (<i>self</i>)</h3><p>Returns the proposed drop action.</p> <p><b>See also</b> <a href="qdropevent.html#dropAction">dropAction</a>().</p> <h3 class="fn"><a name="provides" />bool QDropEvent.provides (<i>self</i>, str)</h3><h3 class="fn"><a name="setDropAction" />QDropEvent.setDropAction (<i>self</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a> <i>action</i>)</h3><p>Sets the <i>action</i> to be performed on the data by the target. Use this to override the <a href="qdropevent.html#proposedAction">proposed action</a> with one of the <a href="qdropevent.html#possibleActions">possible actions</a>.</p> <p>If you set a drop action that is not one of the possible actions, the drag and drop operation will default to a copy operation.</p> <p>Once you have supplied a replacement drop action, call accept() instead of <a href="qdropevent.html#acceptProposedAction">acceptProposedAction</a>().</p> <p><b>See also</b> <a href="qdropevent.html#dropAction">dropAction</a>().</p> <h3 class="fn"><a name="source" /><a href="qwidget.html">QWidget</a> QDropEvent.source (<i>self</i>)</h3><p>If the source of the drag operation is a widget in this application, this function returns that source; otherwise it returns 0. The source of the operation is the first parameter to the <a href="qdrag.html">QDrag</a> object used instantiate the drag.</p> <p>This is useful if your widget needs special behavior when dragging to itself.</p> <p><b>See also</b> <a href="qdrag.html#QDrag">QDrag.QDrag</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>