QTextEdit::setTextFormat(Qt::LogText) does not exi

2019-06-21 04:49发布

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?

2条回答
Animai°情兽
2楼-- · 2019-06-21 05:39

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.
查看更多
Lonely孤独者°
3楼-- · 2019-06-21 05:39

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.

查看更多
登录 后发表回答