QNodeEditor.editor.NodeEditor#
- class QNodeEditor.editor.NodeEditor(parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, allow_multiple_inputs: bool = False)#
Bases:
QWidgetNode editor widget containing a node scene and view
Widget that contains a
NodeSceneand aNodeViewof that scene. To change the node editor, access thesceneattribute to modify the node scene.Properties
Get or set the available nodes in the scene.
errored(PyQt_PyObject)Signal that emits the error if evaluation failed
evaluated(PyQt_PyObject)Signal that emits the evaluation result if successful
Get or set the node that should be used as the output node.
Get or set the theme of the node editor.
Methods
Create a new node editor widget.
Load a node scene state from a file
Save the node scene state to a file.
- __init__(parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, allow_multiple_inputs: bool = False)#
Create a new node editor widget.
- Parameters:
parent (QWidget, optional) – Parent widget for this node editor (if any)
theme (Type[
Theme], optional) – Theme for the node editor (default:DarkTheme)allow_multiple_inputs (bool) – If set to True, multiple edges can be connected to the same node input. Otherwise, only a single edge can be connected to any input.
- load(filepath: str) None#
Load a node scene state from a file
- Parameters:
filepath (str) – Path to file to load node scene state from
- Return type:
None
- save(filepath: str) None#
Save the node scene state to a file.
- Parameters:
filepath (str) – Path to file to save node scene state in
- Return type:
None
- property available_nodes: dict[str, Type[Node]]#
Get or set the available nodes in the scene.
This is a (nested) dictionary with pairs of (name, Type[
Node]). These names are displayed in the context menu in the node editor when adding new nodes. The added node is then of the type provided in the pair with it. Use a nested dictionary to create sub-menus in the context menu.See also
available_nodesmore detailed explanation
- property output_node: Type[Node]#
Get or set the node that should be used as the output node.
This node will not be evaluated, but is used to create the evaluation result. The preceding nodes are evaluated, and the resulting value(s) wired to the output node are recorded and emitted through the
evaluatedsignal.