NodeGraphQt icon indicating copy to clipboard operation
NodeGraphQt copied to clipboard

Undo/Redo for Node Movement is not working

Open EssenOH opened this issue 1 year ago • 1 comments

I am trying to track down an issue and following is the unexpected behavior.

the Undo/Redo for node movement action is successfully registered and then I expects the Undo/Redo call should be triggered within the class NodeMovedCmd(QtGui.QUndoCommand). image

and also the node movement event is successfully captured and emitted event with the node data information. image

unfortunately, the delivered event doesn't hold the node data information and the data is disappeared. so, I am wondering why ? image

image

EssenOH avatar Apr 04 '24 09:04 EssenOH

I found the reason and workaround. It is because of pyside6 bug and then please refer the following link if you are interested porting to pyside6.

https://stackoverflow.com/questions/76579504/how-dose-pyside6-signal-emit-transfer-data-for-dictionary-data-why-the-behavio

the best workaround is just changing the moved_nodes = QtCore.Signal(dict) and insert_node = QtCore.Signal(object, str, dict) to object.

moved_nodes = QtCore.Signal(object) insert_node = QtCore.Signal(object, str, object)

you can keep it as one of tasks for your next version.

EssenOH avatar Apr 05 '24 07:04 EssenOH