nodedge.graphics_scene

Graphics scene module containing GraphicsScene class.

class nodedge.graphics_scene.GraphicsScene(scene: Scene, parent: Optional[PySide2.QtWidgets.QWidget] = None)

Bases: PySide2.QtWidgets.QGraphicsScene

Scene class

The graphics scene contains the background grid.

Parameters
  • scene (Scene) – reference to the Scene

  • parent (QWidget) – parent widget

itemSelected = <PySide2.QtCore.Signal object>

Signal emitted when some item is selected in the Scene

itemsDeselected = <PySide2.QtCore.Signal object>

Signal emitted when items are deselected in the Scene

itemsPressed = <PySide2.QtCore.Signal object>
initUI() → None

Set up this QGraphicsScene

initStyle() → None

Initialize QObjects like QColor, QPen and QBrush

initSizes() → None

Set up internal attributes like grid_size, scene_width and scene_height.

setScene(width, height) → None

Set width and height of the graphics scene.

drawBackground(painter, rectangle) → None

Draw background scene grid.

dragMoveEvent(event: PySide2.QtWidgets.QGraphicsSceneDragDropEvent) → None

Handle Qt’s mouse’s drag move event.

Parameters

event (QGraphicsSceneDragDropEvent.py) – Mouse release event

mousePressEvent(event: PySide2.QtWidgets.QGraphicsSceneMouseEvent) → None

Handle Qt’s mouse’s button press event.

Parameters

event (QGraphicsSceneMouseEvent.py) – Mouse release event

mouseReleaseEvent(event: PySide2.QtWidgets.QGraphicsSceneMouseEvent) → None

Handle Qt’s mouse’s button release event.

Parameters

event (QGraphicsSceneMouseEvent.py) – Mouse release event

fitInView()
Returns

staticMetaObject = <PySide2.QtCore.QMetaObject object>