Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在运行时将自定义 HTML 文件加载到 QTextEdit 中?
一种非常简单的方法。一定要检查文档,寻找错误条件,等等。此外,可能有一种比一次读一行更快的方法。
QFile file( file_name ); QTextStream stream( &file ); QString string; while( !stream.atEnd() ) { stream >> string; ui_textEdit->insertHtml( string ); }