PDA

View Full Version : QProcess start() failure



jacek_
26th November 2009, 11:26
Hello again.

I have a simple code, which is slot function:


void getProducts(){
QProcess progress_process;
QString path(QDir::currentPath()+"/Progress.exe");
progress_process.start(path);
getProductsDo();
//progress_process.close();
}

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?

caduel
26th November 2009, 11:55
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)

nish
26th November 2009, 12:32
better use the static functions of QProcess i.e. execute() .

jacek_
26th November 2009, 13:04
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?