
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.More...
| Header: | #include <QGraphicsSceneDragDropEvent> |
| Since: | Qt 4.2 |
| Inherits: | QGraphicsSceneEvent |
| ~QGraphicsSceneDragDropEvent() | |
| void | acceptProposedAction() |
| Qt::MouseButtons | buttons() const |
| Qt::DropAction | dropAction() const |
| const QMimeData * | mimeData() const |
| Qt::KeyboardModifiers | modifiers() const |
| QPointF | pos() const |
| Qt::DropActions | possibleActions() const |
| Qt::DropAction | proposedAction() const |
| QPointF | scenePos() const |
| QPoint | screenPos() const |
| void | setDropAction(Qt::DropAction action) |
| QWidget * | source() const |
TheQGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.
QGraphicsView inherits the drag and drop functionality provided byQWidget. When it receives a drag and drop event, it translates it to aQGraphicsSceneDragDropEvent.
QGraphicsSceneDragDropEvent stores events of typeGraphicsSceneDragEnter,GraphicsSceneDragLeave,GraphicsSceneDragMove, orGraphicsSceneDrop.
QGraphicsSceneDragDropEvent contains the position of the mouse cursor in both item, scene, and screen coordinates; this can be retrieved withpos(),scenePos(), andscreenPos().
The scene sends the event to the firstQGraphicsItem under the mouse cursor that accepts drops; a graphics item is set to accept drops withsetAcceptDrops().
Destroys the object.
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 callaccept().
See alsodropAction(),setDropAction(), andproposedAction().
Returns aQt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.
See alsoQt::MouseButtons.
Returns the action that was performed in this drag and drop. This should be set by the receiver of the drop and is returned byQDrag::exec().
See alsosetDropAction() andacceptProposedAction().
This function returns the MIME data of the event.
Returns the keyboard modifiers that were pressed when the drag and drop event was created.
See alsoQt::KeyboardModifiers.
Returns the mouse position of the event relative to the view that sent the event.
See alsoQGraphicsView,screenPos(), andscenePos().
Returns the possible drop actions that the drag and drop can result in.
See alsoQt::DropActions.
Returns the drop action that is proposed, i.e., preferred. The action must be one of the possible actions as defined bypossibleActions().
See alsoQt::DropAction andpossibleActions().
Returns the position of the mouse in scene coordinates.
Returns the position of the mouse relative to the screen.
This function lets the receiver of the drop set the drop action that was performed toaction, which should be one of thepossible actions. Callaccept() in stead ofacceptProposedAction() if you use this function.
See alsodropAction(),accept(), andpossibleActions().
This function returns theQGraphicsView that created theQGraphicsSceneDragDropEvent.
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.