All,
I need to call a shell script from within my Qt 4.7 (on Linux) app and QProcess is giving me trouble.
Here is the code that does not work - meaning it does execute the shell script but the environment is false:
myProcess->start(prog, args);
QProcess myProcess(this);
myProcess->start(prog, args);
To copy to clipboard, switch view to plain text mode
I tried setting "PATH" and some other env-variables via myProcess->setEnvironment() but with no effect. But this works fine:
pid_t pID = fork();
if (pID == 0)
execl(prog,prog,args, (char *) 0);
pid_t pID = fork();
if (pID == 0)
execl(prog,prog,args, (char *) 0);
To copy to clipboard, switch view to plain text mode
Any suggestion on what is going on?
Markus
Bookmarks