简体   繁体   English

QLabel与QTextEdit,以显示长文本。 哪个更快?

[英]QLabel vs QTextEdit, to show long text. Which is faster?

I used QTextEdit in read-only mode (I want to make it become Label) to show a long text , but I wonder that when doing like this, how is our performance? 我在只读模式下使用了QTextEdit (我想使其变为Label)来显示长文本 ,但是我想知道当这样做时,我们的性能如何? Will QTextEdit be faster than QLabel or not? QTextEdit会比QLabel快? Is there any better ways to show a long text and to get a good performance? 有没有更好的方法来显示长文本并获得良好的性能? Please help me answer these questions. 请帮助我回答这些问题。

In case you don't have rich text and want to only show plain text, it's better to use QPlainTextEdit which is exactly for showing large texts. 如果您没有富文本并且只想显示纯文本,则最好使用QPlainTextEdit ,它恰好用于显示大文本。 It uses most of the features of QTextEdit but with a vastly better performance. 它使用了QTextEdit大多数功能,但性能却大大提高。

Using QPlainTextEdit is better than using QLabel for displaying large text documents as the former has many more capabilities and features for customization and formatting. 使用QPlainTextEdit优于使用QLabel来显示大型文本文档,因为前者具有许多自定义和格式设置功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM