Results 1 to 4 of 4

Thread: QProcess start() failure

  1. #1
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QProcess start() failure

    Hello again.

    I have a simple code, which is slot function:
    Qt Code:
    1. void getProducts(){
    2. QProcess progress_process;
    3. QString path(QDir::currentPath()+"/Progress.exe");
    4. progress_process.start(path);
    5. getProductsDo();
    6. //progress_process.close();
    7. }
    To copy to clipboard, switch view to plain text mode 
    The problem is I get no errors, no warnings, but new process does not start. I tried executing MS Windows commands and it failed as well. What's wrong? Any tips?

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QProcess start() failure

    Note that the QProcess d'tor kills the process you started.
    (i.e. you have to wait till your process has finished, or allocated the QProcess on the heap)

  3. #3
    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: QProcess start() failure

    better use the static functions of QProcess i.e. execute() .

  4. #4
    Join Date
    Mar 2008
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProcess start() failure

    Quote Originally Posted by MrDeath View Post
    better use the static functions of QProcess i.e. execute() .
    How to kill a process executed that way? I know some system functions, ie. kill(), but I need to know PID to terminate.

    Should I use fork() + execve() + kill()? What do you think?

Similar Threads

  1. QProcess to Start App
    By ManuMies in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2009, 11:58
  2. QProcess dosent want to start firefox
    By Zergi in forum Newbie
    Replies: 2
    Last Post: 17th February 2008, 15:42
  3. QProcess start a console program
    By Shawn in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2007, 12:38
  4. Questions about kill() and start() of QProcess
    By mp33919 in forum Qt Programming
    Replies: 5
    Last Post: 23rd June 2007, 13:00
  5. QProcess start automaticaly needed application
    By raphaelf in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 14:11

Tags for this Thread

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.