Please nominate your Qt Champions for 2021!

A question about QProcess communication

  • I'm using Qt to develop a front end and I attached it to an existing program. I created a new QProcess Object and use it to start the existing program.

    Here is the problem:
    The existing program (we'll call it A afterwards) prints it to the stdout and I use the following code to get the signal readyReadStandardOutput():
    @connect(A, SIGNAL(readyReadStandardOutput()), this, SLOT(updateOutPutEdit()));@
    the SLOT updateOutPutEdit() will read all the standard output and print it to the terminal.

    But I don't know whether A has a buffer or it's the QProcess' problem, the output will always stuck or display after a long time.

    I don't know why...Does Qt has a buffer between the parents' process and the forked one?

  • Qt Champions 2017

    This may be issue with event processing. Are you trying to read this before even starting the event loop ?

Log in to reply