You might be able to run the external program in a QProcess and redirect its stdout into stdin of your Qt program. See QProcess::setProcessChannelMode()

Here's some code from a stackoverflow accepted answer to a similar question:

Qt Code:
  1. p.start( /* whatever your command is, see the doc for param types */ );
  2. p.waitForFinished(-1);
  3.  
  4. QString p_stdout = p.readAllStandardOutput();
To copy to clipboard, switch view to plain text mode 

This, however, blocks your Qt app while the external process is running. You could also connect slots to QProcess signals (finished(), readyReadStandardOutput) and not use waitForFinished. See this other stackoverflow answer.