问题描述
我使用C ++和Qt编写了一个富文本编辑器。
现在,我想支持(至少).odt格式。
I am writing a rich text editor using C++ and Qt.For now, I would like it to support (at least) the .odt format.
我发现QTextDocumentWriter用于将QTextDocument的内容写入文件,但我似乎没有找到任何东西读回到QTextDocument,这显然使保存它是无用的在第一位。
I found QTextDocumentWriter for writing the contents of the QTextDocument to a file, but I can't seem to find anything to read that back into the QTextDocument, which obviously makes saving it sort of useless in the first place.
所以问题是,如何将.odt文档加载到QTextDocument?
So the question is, how do I load an .odt document into a QTextDocument?
推荐答案
Qt目前不支持ODT格式。 具有将ODT解析为QTextDocument的代码。注意:Okular源代码是根据GPL许可证发布的。
Qt does not currently support the ODT format. Okular has code that does parses ODT to a QTextDocument. Beware: Okular source code is released under GPL license.
这篇关于从.odt文件填充QTextDocument的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!