I am trying to wrap a colleges c++ code in a Qt widget.
However, his programs std output necessarily needs to be viewed. As of now I am assuming I will build a GUI and open a QProccess that will run his program (then send commands over that pipe).
So my question is there anyway to read the standard output of that program and display it in a qlabel or something similar (i.e. what functions should I be looking into)?
As the process runs, the
QProcess
object will emit thereadyReadStandardOutput()
signal as soon as there are data available on the standard output. You can subscribe to the signal, callreadAllStandardOutput()
from the connected slot and append (not replace) the data to your widget. If you don't need the data to be displayed as soon as it arrives, you can just wait until the process finishes and then read all the output as once.