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
|
<?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>QGraphicsSceneDragDropEvent 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="../pyqt4ref.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">QGraphicsSceneDragDropEvent Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework. <a href="#details">More...</a></p>
<p>Inherits <a href="qgraphicssceneevent.html">QGraphicsSceneEvent</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicsscenedragdropevent.html#acceptProposedAction">acceptProposedAction</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.MouseButtons <b><a href="qgraphicsscenedragdropevent.html#buttons">buttons</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropAction <b><a href="qgraphicsscenedragdropevent.html#dropAction">dropAction</a></b> (<i>self</i>)</li><li><div class="fn" />QMimeData <b><a href="qgraphicsscenedragdropevent.html#mimeData">mimeData</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.KeyboardModifiers <b><a href="qgraphicsscenedragdropevent.html#modifiers">modifiers</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsscenedragdropevent.html#pos">pos</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qgraphicsscenedragdropevent.html#possibleActions">possibleActions</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropAction <b><a href="qgraphicsscenedragdropevent.html#proposedAction">proposedAction</a></b> (<i>self</i>)</li><li><div class="fn" />QPointF <b><a href="qgraphicsscenedragdropevent.html#scenePos">scenePos</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qgraphicsscenedragdropevent.html#screenPos">screenPos</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsscenedragdropevent.html#setDropAction">setDropAction</a></b> (<i>self</i>, Qt.DropAction)</li><li><div class="fn" />QWidget <b><a href="qgraphicsscenedragdropevent.html#source">source</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.</p>
<p><a href="qgraphicsview.html">QGraphicsView</a> inherits the drag and drop functionality provided by <a href="qwidget.html">QWidget</a>. When it receives a drag and drop event, it translates it to a QGraphicsSceneDragDropEvent.</p>
<p>QGraphicsSceneDragDropEvent stores events of type <a href="qevent.html#Type-enum">GraphicsSceneDragEnter</a>, <a href="qevent.html#Type-enum">GraphicsSceneDragLeave</a>, <a href="qevent.html#Type-enum">GraphicsSceneDragMove</a>, or <a href="qevent.html#Type-enum">GraphicsSceneDrop</a>.</p>
<p>QGraphicsSceneDragDropEvent contains the position of the mouse cursor in both item, scene, and screen coordinates; this can be retrieved with <a href="qgraphicsscenedragdropevent.html#pos">pos</a>(), <a href="qgraphicsscenedragdropevent.html#scenePos">scenePos</a>(), and <a href="qgraphicsscenedragdropevent.html#screenPos">screenPos</a>().</p>
<p>The scene sends the event to the first <a href="qgraphicsitem.html">QGraphicsItem</a> under the mouse cursor that accepts drops; a graphics item is set to accept drops with <a href="qgraphicsitem.html#setAcceptDrops">setAcceptDrops()</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="acceptProposedAction" />QGraphicsSceneDragDropEvent.acceptProposedAction (<i>self</i>)</h3><p>Sets the proposed action as accepted, i.e, the drop action is set to the proposed action. This is equal to:</p>
<pre> setDropAction(proposedAction());</pre>
<p>When using this function, one should not call <tt>accept()</tt>.</p>
<p>See also <a href="qgraphicsscenedragdropevent.html#dropAction">dropAction</a>(), <a href="qgraphicsscenedragdropevent.html#setDropAction">setDropAction</a>(), and <a href="qgraphicsscenedragdropevent.html#proposedAction">proposedAction</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/buttons" />
<h3 class="fn"><a name="buttons" /><a href="qt-mousebuttons.html">Qt.MouseButtons</a> QGraphicsSceneDragDropEvent.buttons (<i>self</i>)</h3><p>Returns a <a href="qt.html#MouseButton-enum">Qt.MouseButtons</a> value indicating which buttons were pressed on the mouse when this mouse event was generated.</p>
<p>See also <a href="qt.html#MouseButton-enum">Qt.MouseButtons</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/dropAction" />
<h3 class="fn"><a name="dropAction" /><a href="qt.html#DropAction-enum">Qt.DropAction</a> QGraphicsSceneDragDropEvent.dropAction (<i>self</i>)</h3><p>Returns the action that was performed in this drag and drop. This should be set by the receiver of the drop and is returned by <a href="qdrag.html#exec">QDrag.exec</a>().</p>
<p>See also <a href="qgraphicsscenedragdropevent.html#setDropAction">setDropAction</a>() and <a href="qgraphicsscenedragdropevent.html#acceptProposedAction">acceptProposedAction</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/mimeData" />
<h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QGraphicsSceneDragDropEvent.mimeData (<i>self</i>)</h3><p>This function returns the MIME data of the event.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/modifiers" />
<h3 class="fn"><a name="modifiers" /><a href="qt-keyboardmodifiers.html">Qt.KeyboardModifiers</a> QGraphicsSceneDragDropEvent.modifiers (<i>self</i>)</h3><p>Returns the keyboard modifiers that were pressed when the drag and drop event was created.</p>
<p>See also <a href="qt.html#KeyboardModifier-enum">Qt.KeyboardModifiers</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/pos" />
<h3 class="fn"><a name="pos" /><a href="qpointf.html">QPointF</a> QGraphicsSceneDragDropEvent.pos (<i>self</i>)</h3><p>Returns the mouse position of the event relative to the view that sent the event.</p>
<p>See also <a href="qgraphicsview.html">QGraphicsView</a>, <a href="qgraphicsscenedragdropevent.html#screenPos">screenPos</a>(), and <a href="qgraphicsscenedragdropevent.html#scenePos">scenePos</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/possibleActions" />
<h3 class="fn"><a name="possibleActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QGraphicsSceneDragDropEvent.possibleActions (<i>self</i>)</h3><p>Returns the possible drop actions that the drag and drop can result in.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt.DropActions</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/proposedAction" />
<h3 class="fn"><a name="proposedAction" /><a href="qt.html#DropAction-enum">Qt.DropAction</a> QGraphicsSceneDragDropEvent.proposedAction (<i>self</i>)</h3><p>Returns the drop action that is proposed, i.e., preferred. The action must be one of the possible actions as defined by <tt>possibleActions()</tt>.</p>
<p>See also <a href="qt.html#DropAction-enum">Qt.DropAction</a> and <a href="qgraphicsscenedragdropevent.html#possibleActions">possibleActions</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/scenePos" />
<h3 class="fn"><a name="scenePos" /><a href="qpointf.html">QPointF</a> QGraphicsSceneDragDropEvent.scenePos (<i>self</i>)</h3><p>Returns the position of the mouse in scene coordinates.</p>
<p>See also <a href="qgraphicsscenedragdropevent.html#pos">pos</a>() and <a href="qgraphicsscenedragdropevent.html#screenPos">screenPos</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/screenPos" />
<h3 class="fn"><a name="screenPos" /><a href="qpoint.html">QPoint</a> QGraphicsSceneDragDropEvent.screenPos (<i>self</i>)</h3><p>Returns the position of the mouse relative to the screen.</p>
<p>See also <a href="qgraphicsscenedragdropevent.html#pos">pos</a>() and <a href="qgraphicsscenedragdropevent.html#scenePos">scenePos</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/setDropAction" />
<h3 class="fn"><a name="setDropAction" />QGraphicsSceneDragDropEvent.setDropAction (<i>self</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a>)</h3><p>This function lets the receiver of the drop set the drop action that was performed to <i>action</i>, which should be one of the <a href="qgraphicsscenedragdropevent.html#possibleActions">possible actions</a>. Call <tt>accept()</tt> in stead of <tt>acceptProposedAction()</tt> if you use this function.</p>
<p>See also <a href="qgraphicsscenedragdropevent.html#dropAction">dropAction</a>(), <a href="qevent.html#accept">accept</a>(), and <a href="qgraphicsscenedragdropevent.html#possibleActions">possibleActions</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsSceneDragDropEvent/source" />
<h3 class="fn"><a name="source" /><a href="qwidget.html">QWidget</a> QGraphicsSceneDragDropEvent.source (<i>self</i>)</h3><p>This function returns the <a href="qgraphicsview.html">QGraphicsView</a> that created the <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a>.</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.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> 2010</td><td align="right" width="25%">Qt 4.6.2</td></tr></table></div></address></body></html>
|