MouseDragEvent — pyqtgraph 0.11.0rc0 documentation

# MouseDragEvent

class `pyqtgraph.GraphicsScene.mouseEvents.` `MouseDragEvent`(moveEvent, pressEvent, lastEvent, start=False, finish=False)

  Instances of this class are delivered to items in a `GraphicsScene` via their mouseDragEvent() method when the item is being mouse-dragged.

  `accept`()

    An item should call this method if it can handle the event. This will prevent the event being delivered to any other items.

  `button`()

    Return the button that initiated the drag (may be different from the buttons currently pressed) (see QGraphicsSceneMouseEvent::button in the Qt documentation)

  `buttonDownPos`(btn=None)

    Return the position of the mouse at the time the drag was initiated in the coordinate system of the item that the event was delivered to.

  `buttonDownScenePos`(btn=None)

    Return the scene position of the mouse at the time btn was pressed. If btn is omitted, then the button that initiated the drag is assumed.

  `buttonDownScreenPos`(btn=None)

    Return the screen position (pixels relative to widget) of the mouse at the time btn was pressed. If btn is omitted, then the button that initiated the drag is assumed.

  `buttons`()

    Return the buttons currently pressed on the mouse. (see QGraphicsSceneMouseEvent::buttons in the Qt documentation)

  `ignore`()

    An item should call this method if it cannot handle the event. This will allow the event to be delivered to other items.

  `isFinish`()

    Returns False if this is the last event in a drag. Note that this event will have the same position as the previous one.

  `isStart`()

    Returns True if this event is the first since a drag was initiated.

  `lastPos`()

    Return the previous position of the mouse in the coordinate system of the item that the event was delivered to.

  `lastScenePos`()

    Return the scene position of the mouse immediately prior to this event.

  `lastScreenPos`()

    Return the screen position of the mouse immediately prior to this event.

  `modifiers`()

    Return any keyboard modifiers currently pressed. (see QGraphicsSceneMouseEvent::modifiers in the Qt documentation)

  `pos`()

    Return the current position of the mouse in the coordinate system of the item that the event was delivered to.

  `scenePos`()

    Return the current scene position of the mouse.

  `screenPos`()

    Return the current screen position (pixels relative to widget) of the mouse.