QNodeEditor.dialog.NodeEditorDialog#
- class QNodeEditor.dialog.NodeEditorDialog(parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, allow_multiple_inputs: bool = False)#
Bases:
QDialogDialog containing a node editor and handling buttons
This dialog houses a node editor and provides an easy way to evaluate scenes. The internal
NodeEditorprovides all the node editing capabilities, and the dialog handles all errors and calculation results for you. TheNodeEditorcan be accessed through theeditorattribute.If the scene is evaluated and no error occurs, the dialog is accepted and closes. If the dialog was opened using
.exec(), this will returnTrue. The calculation result is stored in theresultattribute, such that it can be accessed.If the scene is evaluated and an error does occur, the dialog remains open. An error message appears below the editor with the name of the error. Besides it is a button that opens a popup with the exact error traceback and further details.
Examples
Create a new dialog and run it using the
.exec()method. Once the node scene is successfully evaluated, it will returnTrue(andFalseotherwise). If the scene was evaluated, the result of the calculation can be found in theresultattribute.dialog = NodeEditorDialog() if dialog.exec(): print(dialog.result)
- editor#
Node editor widget that shows an interactive node scene
- Type:
- result#
Result of the evaluated scene (
Noneif not evaluated). There is an item in the dictionary for each input of the selected output node. The keys are the names of the entries, and the values the input result that they received.- Type:
dict[str, Any] or None
Properties
Get or set the theme of the node editor dialog.
Methods
Create a new node editor dialog.
keyPressEventPrevent dialog from closing if return or enter is pressed.
- __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 dialog.
- Parameters:
parent (QWidget, optional) – Parent widget for this dialog (if any)
theme (Type[
Theme], optional) – Theme for the dialog (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.