QNodeEditor.graphics.scene.NodeSceneGraphics#

class QNodeEditor.graphics.scene.NodeSceneGraphics(scene: NodeScene, parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#

Bases: QGraphicsScene

Extension of QGraphicsScene for drawing node scene.

Properties

theme

Get or set the theme of the node scene.

Methods

__init__

Create new node scene graphics.

drawBackground

Draw the scene background.

set_size

Set the size of the scene.

__init__(scene: NodeScene, parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#

Create new node scene graphics.

Parameters:
  • scene (NodeScene) – Node scene these graphics are for

  • parent (QWidget, optional) – Parent widget (if any)

  • theme (Type[Theme], optional) – Theme for the node scene (default: DarkTheme)

set_size(width: int, height: int) None#

Set the size of the scene.

Parameters:
  • width (int or float) – Scene width

  • height (int or float) – Scene height

Return type:

None

property theme: Type[Theme]#

Get or set the theme of the node scene.

Setting the theme will affect all child elements.