QTextEdit::setTextFormat(Qt::LogText) does not exist anymore, what else can I use to log?
Asked Answered
S

2

5

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?

Spearmint answered 17/6, 2010 at 8:44 Comment(0)
M
4

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.
Midas answered 17/6, 2010 at 8:55 Comment(2)
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
M
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.

Masturbation answered 17/6, 2010 at 8:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.