Results 1 to 3 of 3

Thread: problem about kill a QProcess

  1. #1
    Join Date
    May 2010
    Posts
    42

    Question problem about kill a QProcess

    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()?

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem about kill a QProcess

    try terminate()

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem about kill a QProcess

    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

Similar Threads

  1. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  2. Questions about kill() and start() of QProcess
    By mp33919 in forum Qt Programming
    Replies: 5
    Last Post: 23rd June 2007, 13:00
  3. why qte2.3.1 can kill tty? how to solve it?
    By gwhhwgy in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 25th July 2006, 19:59
  4. how to kill parent widget?
    By mahe2310 in forum Qt Programming
    Replies: 3
    Last Post: 23rd March 2006, 12:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.