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?
QTextEdit::setTextFormat(Qt::LogText) does not exist anymore, what else can I use to log?
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. –
Spearmint
@ 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." –
Testy
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.
© 2022 - 2024 — McMap. All rights reserved.