The PySide.QtGui.QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.
PySide.QtGui.QGraphicsView inherits the drag and drop functionality provided by PySide.QtGui.QWidget . When it receives a drag and drop event, it translates it to a PySide.QtGui.QGraphicsSceneDragDropEvent .
PySide.QtGui.QGraphicsSceneDragDropEvent stores events of type GraphicsSceneDragEnter , GraphicsSceneDragLeave , GraphicsSceneDragMove , or GraphicsSceneDrop .
PySide.QtGui.QGraphicsSceneDragDropEvent contains the position of the mouse cursor in both item, scene, and screen coordinates; this can be retrieved with PySide.QtGui.QGraphicsSceneDragDropEvent.pos() , PySide.QtGui.QGraphicsSceneDragDropEvent.scenePos() , and PySide.QtGui.QGraphicsSceneDragDropEvent.screenPos() .
The scene sends the event to the first PySide.QtGui.QGraphicsItem under the mouse cursor that accepts drops; a graphics item is set to accept drops with PySide.QtGui.QGraphicsItem.setAcceptDrops() .
Parameters: | type – PySide.QtCore.QEvent.Type |
---|
Constructs a new PySide.QtGui.QGraphicsSceneDragDropEvent of the specified type . The type can be either QEvent.GraphicsSceneDragEnter , QEvent.GraphicsSceneDragLeave , QEvent.GraphicsSceneDragMove , or QEvent.GraphicsSceneDrop .
Sets the proposed action as accepted, i.e, the drop action is set to the proposed action. This is equal to:
setDropAction(proposedAction())
When using this function, one should not call accept() .
Return type: | PySide.QtCore.Qt.MouseButtons |
---|
Returns a Qt.MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.
See also
Qt.MouseButtons
Return type: | PySide.QtCore.Qt.DropAction |
---|
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 QDrag.exec() .
Return type: | PySide.QtCore.QMimeData |
---|
This function returns the MIME data of the event.
Return type: | PySide.QtCore.Qt.KeyboardModifiers |
---|
Returns the keyboard modifiers that were pressed when the drag and drop event was created.
See also
Qt.KeyboardModifiers
Return type: | PySide.QtCore.QPointF |
---|
Returns the mouse position of the event relative to the view that sent the event.
Return type: | PySide.QtCore.Qt.DropActions |
---|
Returns the possible drop actions that the drag and drop can result in.
See also
Qt.DropActions
Return type: | PySide.QtCore.Qt.DropAction |
---|
Returns the drop action that is proposed, i.e., preferred. The action must be one of the possible actions as defined by possibleActions() .
See also
Qt.DropAction PySide.QtGui.QGraphicsSceneDragDropEvent.possibleActions()
Return type: | PySide.QtCore.QPointF |
---|
Returns the position of the mouse in scene coordinates.
Return type: | PySide.QtCore.QPoint |
---|
Returns the position of the mouse relative to the screen.
Parameters: | buttons – PySide.QtCore.Qt.MouseButtons |
---|
Parameters: | action – PySide.QtCore.Qt.DropAction |
---|
Parameters: | modifiers – PySide.QtCore.Qt.KeyboardModifiers |
---|
Parameters: | pos – PySide.QtCore.QPointF |
---|
Sets the position of the mouse to pos ; this should be relative to the widget that generated the event, which normally is a PySide.QtGui.QGraphicsView .
Parameters: | actions – PySide.QtCore.Qt.DropActions |
---|
Parameters: | action – PySide.QtCore.Qt.DropAction |
---|
Parameters: | pos – PySide.QtCore.QPointF |
---|
Sets the scene position of the mouse to pos .
Parameters: | pos – PySide.QtCore.QPoint |
---|
Sets the mouse position relative to the screen to pos .
Return type: | PySide.QtGui.QWidget |
---|
This function returns the PySide.QtGui.QGraphicsView that created the PySide.QtGui.QGraphicsSceneDragDropEvent .