Does Qt support forked processes
c++, qt
Solution
TL;DR "What can I use from Qt in the fork?" "Anything, as long as you prove to yourself, via code audit, that there are no bugs there related to forking".
None of this is tested for, so nobody knows if anything related to forking used to work, and got broken, and whether it still works.
Qt has a continuous integration system and it is tested on multiple platforms as a prerequisite for staging the changes into a future release. This includes testing for performance regressions in the key areas. IOW, it's not a joke of a test suite, it's for real. The fact that forking is not addressed in the test suite should be a strong signal to you that you're on your own here.
So, you need to take care everywhere, and you need to audit the entirety of Qt code that you call. Sorry, that's the only reasonable answer.
Problem
When I `fork()` in a Qt application, what parts of Qt behave sane? Does Qt support this? Obviously, e.g. the GUI on MacOSX will not work because Cocoa itself does not support forked processes. But there are many other parts, e.g. the list of threads, etc. `QCoreApplication::applicationPid()` seems to return the wrong value. (According to here.) Or to put the question a bit different: I must `fork()` in my app and there are certain parts which might access Qt in the child process. Where do I need to take extra care, despite all the Qt GUI stuff?