PDA

View Full Version : problem about kill a QProcess



Raul
8th June 2010, 05:03
hi guys!
I have started a QProcess object.then i want to kill the QProcess,but,to my suprise,it can't kill the QProcess.my codes are:QProcess myProcess;
myProcess.start("/usr/local/bin/drcomd"); /* the drcomd can be replaced by any other command*/
and few times later,i use "myProcess.kill();"to kill myProcess.but failed.because if i use "ps -e" in the console,i can see the drcomd yet.if i have to get myProcess's pid using myProcess.pid()?

nish
8th June 2010, 08:45
try terminate()

squidge
8th June 2010, 10:50
Terminate sends SIGTERM, whereas kill sends SIGKILL.
SIGTERM requests an application to die, but the application can ignore it.
SIGKILL kills the application without a request.

You should use Terminate first, and if the application doesn't respond within a timely manner, use Kill