Skip to content Skip to sidebar Skip to footer

Pyqt4 Qprocess State Always 0, Various Slots Not Working Too

I am trying to figure out the way QProcess (Linux!) works because I'm going to need it for a project of mine (Note: suprocess or multithreading is not to be used! The process also

Solution 1:

The startDetached function is static. The detached process is started internally by Qt, and so there is never a QProcess that corresponds to it. That is why the signals will not work. In your example script, myProcess is completely redundant.

By definition, a detached process has no direct means of communication with the process that started it. All you get is a pid, and that's it. On some platforms it may be possible to use that pid to kill the process - see os.kill, for instance.

For the same reasons as above, there is no way to re-attach to an existing process. All you have is that pid, which will need to be stored externally somehow (e.g. in a file) if you want to re-use it later.

Broadly speaking, the problem you are dealing with is Inter-process communication (IPC). There are many different solutions available, so you will need to get a much clearer idea of the structure of your application before deciding which one is most appropriate.

Post a Comment for "Pyqt4 Qprocess State Always 0, Various Slots Not Working Too"