flachyjoe wrote: ↑Thu Dec 02, 2021 10:10 am
So even if they are exposed soon my workbench won't be retro-compatible
A workaround is to implement an event filter class that inherits from QtCore.QObject. Inside the overridden function eventFilter() you check for close events and a receiver that inherits from Gui::View3DInventor. If both criterions match return True to filter the close event.
wmayer wrote: ↑Thu Dec 02, 2021 10:53 am
A workaround is to implement an event filter
Looks great !
There can be some limitations though. A same document can have several 3D views open, in which case you probably want to catch only when the last one is closed. Also a document can have no ViewInventor open, for example if only a spreadsheet is open.
/** Called when a document is about to be saved*/
void slotStartSaveDocument(const App::Document&, const std::string&);
I can send a message to Pure-Data to ask the file save, it works well BUT I can't get the file back in FreeCAD.
Objects properties change are not validate while slotStartSaveDocument stops the main loop.
Hi,
I got the save working : I was abused by Log which was obviously shown only after App.ActiveDocument.recompute()
I thunk Pure-Data got the message and save but it only got it after FC saved (server run in the main loop).
So I updateGui after server.send, message go to PD, file is saved and after 500ms delay FC save the change well.
A question is still in suspend (I have to try) does FreeCAD autosave triggers the slotStartSaveDocument ? If it does I will have a problem as I don't want to save the PD change in this case.