You have to provide the whole command to be executed in the terminal as one single argument to QProcess
after "-e"
, as well as the command to be executed in bash as one single argument to bash:
args << "-e" << "bash -c 'foo [args to foo] |& tee foo.log'";
This basically executes
bash -c 'foo [args to foo] |& tee foo.log'
in the terminal, which by itself executes
foo [args to foo] |& tee foo.log
within bash.
You are right with your guess that reading the outputs from the gnome-terminal
process doesn't work.