从.odt文件填充QTextDocument [英] Populate a QTextDocument from a .odt file

查看:681
本文介绍了从.odt文件填充QTextDocument的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用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格式。 Okular 具有将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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆