Qt Jambi Home

com.trolltech.qt.gui
Class QGraphicsSceneDragDropEvent

java.lang.Object
  extended by com.trolltech.qt.QSignalEmitter
      extended by com.trolltech.qt.QtJambiObject
          extended by com.trolltech.qt.core.QEvent
              extended by com.trolltech.qt.gui.QGraphicsSceneEvent
                  extended by com.trolltech.qt.gui.QGraphicsSceneDragDropEvent
All Implemented Interfaces:
QtJambiInterface

public class QGraphicsSceneDragDropEvent
extends QGraphicsSceneEvent

The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framework.

QGraphicsView inherits the drag and drop functionality provided by QWidget. When it receives a drag and drop event, it translates it to a QGraphicsSceneDragDropEvent.

QGraphicsSceneDragDropEvent stores events of type GraphicsSceneDragEnter, GraphicsSceneDragLeave, GraphicsSceneDragMove, or GraphicsSceneDrop.

QGraphicsSceneDragDropEvent contains the position of the mouse cursor in both item, scene, and screen coordinates; this can be retrieved with pos, scenePos, and screenPos.

The scene sends the event to the first QGraphicsItem under the mouse cursor that accepts drops; a graphics item is set to accept drops with setAcceptDrops().


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.core.QEvent
QEvent.Type
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>
 
Constructor Summary
QGraphicsSceneDragDropEvent()
          Equivalent to QGraphicsSceneDragDropEvent(None).
QGraphicsSceneDragDropEvent(QEvent.Type type)
          
 
Method Summary
 void acceptProposedAction()
          Sets the proposed action as accepted, i.e, the drop action is set to the proposed action.
 Qt.MouseButtons buttons()
          Returns a Qt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.
 Qt.DropAction dropAction()
          Returns the action that was performed in this drag and drop.
static QGraphicsSceneDragDropEvent fromNativePointer(QNativePointer nativePointer)
          This function returns the QGraphicsSceneDragDropEvent instance pointed to by nativePointer
 QMimeData mimeData()
          This function returns the MIME data of the event.
 Qt.KeyboardModifiers modifiers()
          Returns the keyboard modifiers that were pressed when the drag and drop event was created.
 QPointF pos()
          Returns the mouse position of the event relative to the view that sent the event.
 Qt.DropActions possibleActions()
          Returns the possible drop actions that the drag and drop can result in.
 Qt.DropAction proposedAction()
          Returns the drop action that is proposed, i.e., preferred.
 QPointF scenePos()
          Returns the position of the mouse in scene coordinates.
 QPoint screenPos()
          Returns the position of the mouse relative to the screen.
 void setButtons(Qt.MouseButton... buttons)
          
 void setButtons(Qt.MouseButtons buttons)
          
 void setDropAction(Qt.DropAction action)
          This function lets the receiver of the drop set the drop action that was performed to action, which should be one of the possible actions.
 void setModifiers(Qt.KeyboardModifier... modifiers)
          
 void setModifiers(Qt.KeyboardModifiers modifiers)
          
 void setPos(QPointF pos)
          
 void setPossibleActions(Qt.DropAction... actions)
          
 void setPossibleActions(Qt.DropActions actions)
          
 void setProposedAction(Qt.DropAction action)
          
 void setScenePos(QPointF pos)
          
 void setScreenPos(QPoint pos)
          
 QWidget source()
          This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.
 
Methods inherited from class com.trolltech.qt.gui.QGraphicsSceneEvent
widget
 
Methods inherited from class com.trolltech.qt.core.QEvent
accept, ignore, isAccepted, setAccepted, setT, spontaneous, t, type
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QGraphicsSceneDragDropEvent

public QGraphicsSceneDragDropEvent()

Equivalent to QGraphicsSceneDragDropEvent(None).


QGraphicsSceneDragDropEvent

public QGraphicsSceneDragDropEvent(QEvent.Type type)

Method Detail

acceptProposedAction

public final void 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().

See Also:
dropAction, setDropAction, proposedAction

buttons

public final Qt.MouseButtons buttons()

Returns a Qt::MouseButtons value indicating which buttons were pressed on the mouse when this mouse event was generated.

See Also:
setButtons, Qt::MouseButtons

dropAction

public final Qt.DropAction 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::start().

See Also:
setDropAction, acceptProposedAction

mimeData

public final QMimeData mimeData()

This function returns the MIME data of the event.


modifiers

public final Qt.KeyboardModifiers modifiers()

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

See Also:
setModifiers, Qt::KeyboardModifiers

pos

public final QPointF pos()

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

See Also:
setPos, QGraphicsView, screenPos, scenePos

possibleActions

public final Qt.DropActions possibleActions()

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

See Also:
setPossibleActions, Qt::DropActions

proposedAction

public final Qt.DropAction proposedAction()

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:
setProposedAction, Qt::DropAction, possibleActions

scenePos

public final QPointF scenePos()

Returns the position of the mouse in scene coordinates.

See Also:
setScenePos, pos, screenPos

screenPos

public final QPoint screenPos()

Returns the position of the mouse relative to the screen.

See Also:
setScreenPos, pos, scenePos

setButtons

public final void setButtons(Qt.MouseButton... buttons)

See Also:
Qt::MouseButtons, buttons

setButtons

public final void setButtons(Qt.MouseButtons buttons)

See Also:
Qt::MouseButtons, buttons

setDropAction

public final void setDropAction(Qt.DropAction action)

This function lets the receiver of the drop set the drop action that was performed to action, which should be one of the possible actions. Call accept() in stead of acceptProposedAction() if you use this function.

See Also:
dropAction, accept, possibleActions

setModifiers

public final void setModifiers(Qt.KeyboardModifier... modifiers)

See Also:
Qt::KeyboardModifiers, modifiers

setModifiers

public final void setModifiers(Qt.KeyboardModifiers modifiers)

See Also:
Qt::KeyboardModifiers, modifiers

setPos

public final void setPos(QPointF pos)

See Also:
pos, setScenePos, setScreenPos

setPossibleActions

public final void setPossibleActions(Qt.DropAction... actions)

See Also:
Qt::DropActions, possibleActions

setPossibleActions

public final void setPossibleActions(Qt.DropActions actions)

See Also:
Qt::DropActions, possibleActions

setProposedAction

public final void setProposedAction(Qt.DropAction action)

See Also:
proposedAction, Qt::DropAction, possibleActions

setScenePos

public final void setScenePos(QPointF pos)

See Also:
scenePos, setScreenPos, setPos

setScreenPos

public final void setScreenPos(QPoint pos)

See Also:
screenPos, setScenePos, setPos

source

public final QWidget source()

This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.


fromNativePointer

public static QGraphicsSceneDragDropEvent fromNativePointer(QNativePointer nativePointer)
This function returns the QGraphicsSceneDragDropEvent instance pointed to by nativePointer

Parameters:
nativePointer - the QNativePointer of which object should be returned.

Qt Jambi Home