Use QTextEdit for output. It supports multiple lines and you can control colors using HTML. Then use single line QLineEdit for entering commands. Place the QLineEdit under the QTextEdit and there you have a GUI for a simple command interface! When you enter a command to the QLineEdit, print it to the QTextEdit too, perhaps using different color than the results of the command.
This is much easier than trying to do everything with one widget.