paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
2.92k stars 795 forks source link

Add a signal `modified` for the scene. #370

Closed zmoth closed 3 months ago

zmoth commented 1 year ago

This signal is sent when nodes or connections change.

Many editors will have a file modified flag after modifying the file. We can connect this signal to determine which scene has been modified. image image

Daguerreo commented 1 year ago

It could be interesting adding it in the calculator example. Should be quite simple, connecting the modified signal to the QWidget::setWindowModified(bool).

connect(scene, &BasicGraphicsScene::modified, this, [this](){ setWindowsModified(true); };

zmoth commented 1 year ago

@Daguerreo I have made changes to the calculator example. In order to be able to remove the flag when saving and keep it when saving aborts. I had to make changes to the save() and load() functions image