问题
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?
回答1:
Two options:
- You could simply use
QTextEdit::setReadOnly(true), the oldQt::LogTextflag basically just put theQTextEditin plain-text read-only mode. - Or use
Q3TextEdit, the Qt4 compatibility class for the old Qt3QTextEdit.
回答2:
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.
来源:https://stackoverflow.com/questions/3060141/qtexteditsettextformatqtlogtext-does-not-exist-anymore-what-else-can-i-us