views:

55

answers:

2

Hi,

I need a text logger in my C++ application, QTextEdit used to have this feature until Qt 3.3 but unfortunately it has been removed. Is there an alternative that I could use?

Tanks for your help!

+3  A: 

Two options:

  1. You could simply use QTextEdit::setReadOnly(true), the old Qt::LogText flag basically just put the QTextEdit in plain-text read-only mode.
  2. Or use Q3TextEdit, the Qt4 compatibility class for the old Qt3 QTextEdit.
Greg S
Thanks a lot, I did not know Q3TextEdit existed, I will use it.
walki
@ user363778 - Instead of using Q3TextEdit, it's better if you use QTextEdit in the above way. From Qt documentation - **"We strongly advise against using it (Q3TextEdit) in new code."**
liaK
+1  A: 

It seems to me that QPlainTextEdit is what you are looking for.

It is optimized for dealing with plain text data and can be can put it in read only.

Jérôme