• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QGraphicsSceneResizeEvent

    下一话题

    QGraphicsSceneHelpEvent

    QGraphicsSceneDragDropEvent

    概要

    详细描述

    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 ,或 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() ,和 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() .

    class PySide.QtGui. QGraphicsSceneDragDropEvent ( [ type=None ] )
    参数: type PySide.QtCore.QEvent.Type

    构造新 PySide.QtGui.QGraphicsSceneDragDropEvent 的指定 type . The type can be either QEvent.GraphicsSceneDragEnter , QEvent.GraphicsSceneDragLeave , QEvent.GraphicsSceneDragMove ,或 QEvent.GraphicsSceneDrop .

    PySide.QtGui.QGraphicsSceneDragDropEvent. acceptProposedAction ( )

    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() .

    PySide.QtGui.QGraphicsSceneDragDropEvent. buttons ( )
    返回类型: PySide.QtCore.Qt.MouseButtons

    返回 Qt.MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.

    另请参阅

    Qt.MouseButtons

    PySide.QtGui.QGraphicsSceneDragDropEvent. dropAction ( )
    返回类型: 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() .

    PySide.QtGui.QGraphicsSceneDragDropEvent. mimeData ( )
    返回类型: PySide.QtCore.QMimeData

    This function returns the MIME data of the event.

    PySide.QtGui.QGraphicsSceneDragDropEvent. modifiers ( )
    返回类型: PySide.QtCore.Qt.KeyboardModifiers

    Returns the keyboard modifiers that were pressed when the drag and drop event was created.

    另请参阅

    Qt.KeyboardModifiers

    PySide.QtGui.QGraphicsSceneDragDropEvent. pos ( )
    返回类型: PySide.QtCore.QPointF

    Returns the mouse position of the event relative to the view that sent the event.

    PySide.QtGui.QGraphicsSceneDragDropEvent. possibleActions ( )
    返回类型: PySide.QtCore.Qt.DropActions

    Returns the possible drop actions that the drag and drop can result in.

    另请参阅

    Qt.DropActions

    PySide.QtGui.QGraphicsSceneDragDropEvent. proposedAction ( )
    返回类型: 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() .

    PySide.QtGui.QGraphicsSceneDragDropEvent. scenePos ( )
    返回类型: PySide.QtCore.QPointF

    Returns the position of the mouse in scene coordinates.

    PySide.QtGui.QGraphicsSceneDragDropEvent. screenPos ( )
    返回类型: PySide.QtCore.QPoint

    Returns the position of the mouse relative to the screen.

    PySide.QtGui.QGraphicsSceneDragDropEvent. setButtons ( buttons )
    参数: buttons PySide.QtCore.Qt.MouseButtons
    PySide.QtGui.QGraphicsSceneDragDropEvent. setDropAction ( action )
    参数: action PySide.QtCore.Qt.DropAction
    PySide.QtGui.QGraphicsSceneDragDropEvent. setModifiers ( modifiers )
    参数: modifiers PySide.QtCore.Qt.KeyboardModifiers
    PySide.QtGui.QGraphicsSceneDragDropEvent. setPos ( pos )
    参数: 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 .

    PySide.QtGui.QGraphicsSceneDragDropEvent. setPossibleActions ( actions )
    参数: actions PySide.QtCore.Qt.DropActions
    PySide.QtGui.QGraphicsSceneDragDropEvent. setProposedAction ( action )
    参数: action PySide.QtCore.Qt.DropAction
    PySide.QtGui.QGraphicsSceneDragDropEvent. setScenePos ( pos )
    参数: pos PySide.QtCore.QPointF

    Sets the scene position of the mouse to pos .

    PySide.QtGui.QGraphicsSceneDragDropEvent. setScreenPos ( pos )
    参数: pos PySide.QtCore.QPoint

    Sets the mouse position relative to the screen to pos .

    PySide.QtGui.QGraphicsSceneDragDropEvent. source ( )
    返回类型: PySide.QtGui.QWidget

    This function returns the PySide.QtGui.QGraphicsView that created the PySide.QtGui.QGraphicsSceneDragDropEvent .