Editor widget
The widget you embed in your application. It creates a Scene and the
graphics view that shows it.
nodeeditor.node_editor_widget ¶
A module containing NodeEditorWidget class
NodeEditorWidget ¶
Bases: QWidget
Widget hosting a graph :class:~nodeeditor.node_scene.Scene and its graphics view.
The Scene and the GraphicsView classes used by this widget can be replaced
by subclasses through the Scene_class and GraphicsView_class attributes.
initUI ¶
Set up this NodeEditorWidget with its layout, :class:~nodeeditor.node_scene.Scene and
:class:~nodeeditor.node_graphics_view.QDMGraphicsView
isModified ¶
Has the Scene been modified?
:return: True if the Scene has been modified
:rtype: bool
isFilenameSet ¶
Do we have a graph loaded from file or are we creating a new one?
:return: True if filename is set. False if it is a new graph not yet saved to a file
:rtype: ''bool''
getSelectedItems ¶
Shortcut returning Scene's currently selected items
:return: list of QGraphicsItems
:rtype: list[QGraphicsItem]
hasSelectedItems ¶
Is there something selected in the :class:nodeeditor.node_scene.Scene?
:return: True if there is something selected in the Scene
:rtype: bool
getUserFriendlyFilename ¶
Get user friendly filename. Used in the window title
:return: just a base name of the file or 'New Graph'
:rtype: str
fileLoad ¶
Load serialized graph from JSON file
:param filename: file to load
:type filename: str
fileSave ¶
Save serialized graph to JSON file. When called with an empty parameter, we won't store/remember the filename.
:param filename: file to store the graph
:type filename: str
:return: True if the file was saved successfully, False otherwise
addDebugContent ¶
Testing method to put random QGraphicsItems and elements into QGraphicsScene