I am currently making a GUI using QT4.8 which basically needs to launch a console application. However, because this console application tries to fetch some environment variables, I can't seem to manage to make this work. I am using QProcess obviously and have tried several solutions :
process->start("./yarpbridge", QStringList() << "--from" << "tmp.ini");
This solution does not spawn a console window and besides, by redirecting the output to qDebug()
, it prints the erros corresponding to the lack of environment variables.
process->start("gnome-terminal", QStringList() << "-e" << "zsh" << "-c" << "\"./yarpbridge --from tmp.ini"\");
This solution does launch a console window but it nevertheless displays the error messages because somehow .zshrc was probably not consulted when opening the console window.
Would you have a solution that would allow me to do this, and even better that would not only work with "gnome-terminal" and "zsh" users ?
Thanks a lot,