标签:blog http io ar os 使用 sp for on
要求: 能够控制显示的总共行数。但不想要太重量级,简单显示就好。
If you want to limit the total number of paragraphs in a QPlainTextEdit, as it is for example useful in a log viewer, then you can use the maximumBlockCount property. The combination of
setMaximumBlockCount()
andappendPlainText()
turnsQPlainTextEdit
into an efficient viewer for log text. The scrolling can be reduced with thecenterOnScroll()
property, making the log viewer even faster. Text can be formatted in a limited way, either using a syntax highlighter (see below), or by appending html-formatted text withappendHtml()
. WhileQPlainTextEdit
does not support complex rich text rendering with tables and floats, it does support limited paragraph-based formatting that you may need in a log viewer.
组合 setMaximumBlockCount() 和 appendPlainText() 方法,来实现logger的显示,可以控制总共显示的行数。
可以设置总行数来控制显示的日志数量。
可参考Qt之日志输出文件,相对容易实现点。
标签:blog http io ar os 使用 sp for on
原文地址:http://my.oschina.net/gongshang/blog/353590