[Qt-interest] QPlainTextEdit or QPlainText

Matthias Ettrich matthias.ettrich at nokia.com
Tue Jun 16 18:08:30 CEST 2009


On Friday 12 June 2009 16:45:11 Ferenc Stelcz wrote:
[...]
>
> I would reimplement the debug methods of Qt, then use qInstallMsgHandler to
> activate them. Would use a QTextEdit with rich-text support. Then in the
> message handlers I would print some red colored html for qWarning and black
> colored html for qDebug into the QTextEdit. (something like <p><font
> color="red">this is an error</font></p>) This is ugly and old-style but a
> solution. :) :)


Good suggestion, Ferenc. Only one small addition: you could (and should) still 
use a QPlainTextEdit for that. It has a method QPlainTextEdit::appendHtml().

Won't do tables and some of the more advanced stuff properly, but colors and 
fonts should work just fine. And it's faster for longer documents.

Matthias




More information about the Qt-interest-old mailing list