Console/Terminal Widget for Qt?
QConsole used to do something like that. (Not sure the project is active anymore, but you might want to have a look).
Found some decent source code here. Very basic functionality, but I've been adding to it some and I think it has promise to do what I need it to.
NOTE: I have only tested this code in Win32.
Here is a link to my new question concerning this code.