Search code examples
qtqt4qtexteditqprocess

Piping output of a QIODevice to a QTextEdit


How to I make the output of a QIODevice (QProcess, specifically) go into a QTextEdit in real time?


Solution

  • Connect the QProcess::readyRead signal to a slot that then reads from the QProcess using QProcess::readAllStandardOutput and writes the text to the QTextEdit with QTextEdit::append.