Markus
18th November 2013, 18:41
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:
QProcess myProcess(this);
myProcess->start(prog, args);
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);
Any suggestion on what is going on?
Markus
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:
QProcess myProcess(this);
myProcess->start(prog, args);
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);
Any suggestion on what is going on?
Markus