QGraphicsSceneDragDropEvent Class Reference

[QtGui module]

该QGraphicsSceneDragDropEvent类提供了拖放在图形视图框架的事件。More…

继承QGraphicsSceneEvent

Methods

  • acceptProposedAction (self)
  • Qt.MouseButtons buttons (self)
  • Qt.DropAction dropAction (self)
  • QMimeData mimeData (self)
  • Qt.KeyboardModifiers modifiers (self)
  • QPointF pos (self)
  • Qt.DropActions possibleActions (self)
  • Qt.DropAction proposedAction (self)
  • QPointF scenePos (self)
  • QPoint screenPos (self)
  • setDropAction (self, Qt.DropAction action)
  • QWidget source (self)

Detailed Description

该QGraphicsSceneDragDropEvent类提供了拖放在图形视图框架的事件。

QGraphicsView继承提供的拖放功能QWidget。当它收到一个拖放事件,它转换到一个QGraphicsSceneDragDropEvent 。

类型QGraphicsSceneDragDropEvent店活动GraphicsSceneDragEnterGraphicsSceneDragLeaveGraphicsSceneDragMoveGraphicsSceneDrop

QGraphicsSceneDragDropEvent包含鼠标光标的位置在这两个项目,场景,和屏幕坐标,这可以检索与pos( )scenePos()和screenPos( ) 。

现场将事件发送到所述第一QGraphicsItem接受滴鼠标光标下,一个图形项目被设定为接受滴用setAcceptDrops()


Method Documentation

  1. QGraphicsSceneDragDropEvent.acceptProposedAction (self)

设置为接受所建议的行动,即降操作设置为所建议的行动。这等于:

  1. setDropAction(proposedAction());

使用此功能时,应该不叫accept()

See also dropAction( )setDropAction()和proposedAction( ) 。

  1. Qt.MouseButtons QGraphicsSceneDragDropEvent.buttons (self)

返回Qt.MouseButtons值,表示该按钮被时生成此鼠标事件鼠标按下。

See also Qt.MouseButtons

  1. Qt.DropAction QGraphicsSceneDragDropEvent.dropAction (self)

返回此拖放进行的操作。这应该由液滴的接收器被设置,并通过返回QDrag.exec( ) 。

See also setDropAction()和acceptProposedAction( ) 。

  1. QMimeData QGraphicsSceneDragDropEvent.mimeData (self)

[

该函数返回事件的MIME数据。

](qmimedata.html)

  1. Qt.KeyboardModifiers QGraphicsSceneDragDropEvent.modifiers (self)

[

返回拖放事件被创建时所按下键盘功能键。

]($docs-index.htm)

See also Qt.KeyboardModifiers

  1. QPointF QGraphicsSceneDragDropEvent.pos (self)

[

返回到发送的事件查看事件相对的鼠标位置。

]($docs-qpointf.html)

See also QGraphicsViewscreenPos()和scenePos( ) 。

  1. Qt.DropActions QGraphicsSceneDragDropEvent.possibleActions (self)

[

返回的可能的放置动作的拖放会导致英寸

]($docs-index.htm)

See also Qt.DropActions

  1. Qt.DropAction QGraphicsSceneDragDropEvent.proposedAction (self)

[

返回最好建议的下拉作用,即, 。所定义的动作必须为可能采取的行动之一possibleActions()

]($docs-qt.html#DropAction-enum)

See also Qt.DropActionpossibleActions( ) 。

  1. QPointF QGraphicsSceneDragDropEvent.scenePos (self)

[

返回鼠标在场景坐标中的位置。

]($docs-qpointf.html)

See also pos()和screenPos( ) 。

  1. QPoint QGraphicsSceneDragDropEvent.screenPos (self)

[

返回到屏幕上的鼠标相对的位置。

]($docs-qpoint.html)

See also pos()和scenePos( ) 。

  1. QGraphicsSceneDragDropEvent.setDropAction (self, Qt.DropAction action)

此功能可下拉的接收器设置进行到下拉动作action,这应该是一个possible actions。通话accept()在代替acceptProposedAction()如果您使用此功能。

See also dropAction( )accept()和possibleActions( ) 。

  1. QWidget QGraphicsSceneDragDropEvent.source (self)

该函数返回QGraphicsView创建该QGraphicsSceneDragDropEvent