Capture the full output of QProcess (including its child processes)
-
Hi,
I'm trying to implement a Qt program to run git grammatically. I do this using QProcess to trigger git.
but I realized the output of git isn't enacted. I read the output via QProcess' readReady readAll function.
I figured out the reason is that git execute different commands using different child processes, certain outputs are generated by those child processes.
And QProcess doesn't seem to be able to capture the outputs of child processes.
Taking the git clone command as an example,
the main process git will print a message "cloning into xxx ...."
then, the actual cloning is carried out by a process called git-https-remote under /usr/lib/git-coreQProcess can't capture the stdout of git-https-remote
Thanks,
-
I have figured out a workaround by requesting progress when performing git clone
based on
https://stackoverflow.com/questions/37669115/how-to-redirect-full-output-of-git-clone-to-a-file
-
@billconan Then please mark this thread as solved.
Thanks and Merry Christmas.