Replies: 1 comment
-
There are multiple ways of doing this of course, What solution you prefer depends on how you design and use Qt and object-orientation in general. However, a simply dirty way it so put a wait before
and then call |
Beta Was this translation helpful? Give feedback.
-
There is a part of python script as follows, these functions call C++ functions.
GenerateMesh start external QProcess to do real task, then return immediatly. It's async. There is another function reciving QProcess::finished signal to do some other work.
CloseProject closes the program.
This design has a fatal problem. GenerateMesh is async, CloseProject is invoked, at this point, the child process is not finished.
A possible solution is move all python operation to subthread, and make GeneratorMesh synchronous. but other function do a lot of UI operation.
Is there a proper way to block or pause python running?
Beta Was this translation helpful? Give feedback.
All reactions