node_editor_window Module

A module containing the Main Window class

class nodeeditor.node_editor_window.NodeEditorWindow

Bases: PyQt5.QtWidgets.QMainWindow

Instance Attributes

  • name_company - name of the company, used for permanent profile settings

  • name_product - name of this App, used for permanent profile settings

NodeEditorWidget_class

alias of nodeeditor.node_editor_widget.NodeEditorWidget

initUI()

Set up this QMainWindow. Create NodeEditorWidget, Actions and Menus

sizeHint(self)QSize
createStatusBar()

Create Status bar and connect to Graphics View scenePosChanged event

createActions()

Create basic File and Edit actions

createMenus()

Create Menus for File and Edit

createFileMenu()
createEditMenu()
setTitle()

Function responsible for setting window title

closeEvent(event)

Handle close event. Ask before we loose work

isModified()bool

Has current Scene been modified?

Returns

True if current Scene has been modified

Return type

bool

getCurrentNodeEditorWidget()nodeeditor.node_editor_widget.NodeEditorWidget

get current node_editor_widget

Returns

get current node_editor_widget

Return type

node_editor_widget

maybeSave()bool

If current Scene is modified, ask a dialog to save the changes. Used before closing window / mdi child document

Returns

True if we can continue in the Close Event and shutdown. False if we should cancel

Return type

bool

onScenePosChanged(x: int, y: int)

Handle event when cursor position changed on the Scene

Parameters
  • x – new cursor x position

  • y – new cursor y position

getFileDialogDirectory()

Returns starting directory for QFileDialog file open/save

getFileDialogFilter()

Returns str standard file open/save filter for QFileDialog

onFileNew()

Hande File New operation

onFileOpen()

Handle File Open operation

onFileSave()

Handle File Save operation

onFileSaveAs()

Handle File Save As operation

onBeforeSaveAs(current_nodeeditor: nodeeditor.node_editor_widget.NodeEditorWidget, filename: str)

Event triggered after choosing filename and before actual fileSave(). We are passing current_nodeeditor because we will loose focus after asking with QFileDialog and therefore getCurrentNodeEditorWidget will return None

onEditUndo()

Handle Edit Undo operation

onEditRedo()

Handle Edit Redo operation

onEditDelete()

Handle Delete Selected operation

onEditCut()

Handle Edit Cut to clipboard operation

onEditCopy()

Handle Edit Copy to clipboard operation

onEditPaste()

Handle Edit Paste from clipboard operation

readSettings()

Read the permanent profile settings for this app

writeSettings()

Write the permanent profile settings for this app