I'm using python with qt and i cannot find out a way to fire a signal when Qprocess exit normally, According to Pyqt documentation finished() signal can take 2 arguments exitCode and exitStatus
This is what Pyqt documentation says about finished() signal
http://pyqt.sourceforge.net/Docs/PyQt4/qprocess.html#finished
void finished (int, ::QProcess::ExitStatus)
This is the default overload of this signal.
This signal is emitted when the process finishes. exitCode is the exit code of the process, and exitStatus is the exit status. After the process has finished, the buffers in QProcess are still intact. You can still read any data that the process may have written before it finished.
QProcess.ExitStatus
This enum describes the different exit statuses of QProcess.
Constant..................Value.........Description
QProcess.NormalExit....... 0.......The process exited normally.
QProcess.CrashExit........ 1.......The process crashed.
I tried to use this syntax but it did't work
self.process.finished(0,QProcess_ExitStatus=0).connect(self.status)
Remark:
Status is just as symbol for any slot (any action ) not something specific
Update:
To get a sense of the problem I've more than one process (Think of it as queue) i need python to execute the first process and only move to the next one if the previous process exits normally not forced to exit using kill() or terminate()
Thanks in advance
self.process.finished[int, QProcess.ExitStatus].connect(self.status)or justself.process.finished.connect(self.status)(which gets the default). - ekhumoroself.process.finished.connect(self.status), and it will do the right thing. TheQProcesswill automatically send the correct exit code and status when it emits the signal. So you just need to connectfinishedto a slot that takes two arguments, and then check the value of the arguments to decide what your code should do next. - ekhumoro