Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QGraphicsSceneEvent

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.core.QEvent
                  com.trolltech.qt.gui.QGraphicsSceneEvent

All Implemented Interfaces:
  QtJambiInterface

Direct Known Subclasses:
  QGraphicsSceneContextMenuEvent, QGraphicsSceneDragDropEvent, QGraphicsSceneHelpEvent, QGraphicsSceneHoverEvent, QGraphicsSceneMouseEvent, QGraphicsSceneMoveEvent, QGraphicsSceneResizeEvent, QGraphicsSceneWheelEvent

    public class QGraphicsSceneEvent

extends QEvent

The `QGraphicsSceneEvent` class provides a base class for all graphics view related events. When a `QGraphicsView` receives Qt mouse, keyboard, and drag and drop events (`QMouseEvent`, `QKeyEvent`, `QDragEvent`, etc.), it translates them into instances of `QGraphicsSceneEvent` subclasses and forwards them to the `QGraphicsScene` it displays. The scene then forwards the events to the relevant items.

For example, when a `QGraphicsView` receives a `QMouseEvent` of type `MousePress` as a response to a user click, the view sends a `QGraphicsSceneMouseEvent` of type `GraphicsSceneMousePress` to the underlying `QGraphicsScene` through its `mousePressEvent()` function. The default `QGraphicsScene::mousePressEvent()` implementation determines which item was clicked and forwards the event to `QGraphicsItem::mousePressEvent()`.

Subclasses such as `QGraphicsSceneMouseEvent` and `QGraphicsSceneContextMenuEvent` provide the coordinates from the original `QEvent` in screen, scene, and item coordinates (see `screenPos()`, `scenePos()`, and `pos()`). The item coordinates are set by the `QGraphicsScene` before it forwards the event to the event to a `QGraphicsItem`. The mouse events also add the possibility to retrieve the coordinates from the last event received by the view (see `lastScreenPos()`, `lastScenePos()`, and `lastPos()`).

See also:
  `QEvent`.

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.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9`

Method Summary
`static QGraphicsSceneEvent` | `fromNativePointer(QNativePointer nativePointer)` This method returns the QGraphicsSceneEvent instance pointed to by `nativePointer`.
`java.lang.String` | `toString()` Returns a string representation of the `this QGraphicsSceneEvent`.
`QWidget` | `widget()` Returns the widget where the event originated, or 0 if the event originates from another application.

Methods inherited from class com.trolltech.qt.core.QEvent
`accept, ignore, isAccepted, registerEventType, registerEventType, setAccepted, setT, spontaneous, t, type`

Methods inherited from class com.trolltech.qt.QtJambiObject
`dispose, disposed, equals, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Method Detail

### widget

    public final QWidget widget()

  Returns the widget where the event originated, or 0 if the event originates from another application.

### fromNativePointer

    public static QGraphicsSceneEvent fromNativePointer(QNativePointer nativePointer)

  This method returns the QGraphicsSceneEvent instance pointed to by `nativePointer`.

### toString

    public java.lang.String toString()

  Returns a string representation of the `this QGraphicsSceneEvent`.

  Overrides:
    `toString` in class `QEvent`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD