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?
Asked
Active
Viewed 3,251 times
2 Answers
4
Two options:
- You could simply use
QTextEdit::setReadOnly(true)
, the oldQt::LogText
flag basically just put theQTextEdit
in plain-text read-only mode. - Or use
Q3TextEdit
, the Qt4 compatibility class for the old Qt3QTextEdit
.
-
Thanks a lot, I did not know Q3TextEdit existed, I will use it. – Linoliumz Jun 17 '10 at 09:01
-
2@ 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 Jun 17 '10 at 09:12
3
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.