Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 472
Linoliumz Avatar asked Jun 17 '10 08:06

Linoliumz


2 Answers

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.
like image 167
Greg S Avatar answered Nov 18 '22 11:11

Greg S


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.

like image 3
Jérôme Avatar answered Nov 18 '22 09:11

Jérôme