It's crashing because you're deleting the sender object while inside a slot. Instead of delete process
, you should
process->deleteLater();
For logging purposes you should be using QPlainTextEdit
instead of a QTextEdit
. The former is faster. You're prematurely pessimizing by using the latter. Alas, even QPlainTextEdit
becomes abysmally slow if you're sending about 100 lines/s (at least on Qt 4.8). If you want a really fast log view, you'll need to use QListWidget
, with a caveat, or roll your own.
I have a complete example of how to send to and receive from a process in another answer.