使用C ++ / Qt读(和写)RTF文件 [英] Read (and write) RTF files with C++ / Qt
问题描述
我正在寻找一个简单的C ++库用于标记和解析RTF(RTF格式)文件。我计划使用Qt的QTextEdit编辑它们。
I am looking for a simple C++ library for tokenizing and parsing RTF (Rich Text Format) files. I am planning to edit them with Qt's QTextEdit.
更多格式保存更好 - 但实际上我计划只使用粗体和斜体。
More the Formatting preserved the better -- but actually I am planning to use Bold and Italics only.
在perl中,我将使用 RTF: :Tokenizer 。
In perl I would use RTF::Tokenizer.
如果模块有一些写作接口,这将是很好,但我可以暴力强制与模板和一些正则表达式...:)
It would be nice if the module had some sort of interface for writing also, but I am able to brute force that with a template and some regular expressions... :)
谢谢。
推荐答案
我帮助在KOffice编写RTF导入导出过滤器。您可以查看 http://websvn.kde.org上的代码/ trunk / koffice / filters / kword / rtf / 或者只是checkout(通过subversion)。代码是模块化的,它只依赖于Qt。
I helped writing the RTF import export filter in KOffice. You can have a look at the code at http://websvn.kde.org/trunk/koffice/filters/kword/rtf/ or just checkout (via subversion). The code is modular and it depends only on Qt.
这篇关于使用C ++ / Qt读(和写)RTF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!