如何使用KDE的RTF导出功能?

发布于 2024-09-08 15:03:28 字数 304 浏览 6 评论 0原文

在 stackoverflow.com 我发现一个问题,用户建议使用 this KDE 库,以便导出/导入 RTF 文件。但是,当我下载时,我发现 .cc 和 .h 文件中包含的许多文件丢失了。因此,请提示如何下载所有必要的文件,是否有任何指南提供并举例说明如何使用 RTF 导出示例(或说明)?

顺便说一句,如果您曾经以更好的方式以编程方式完成 RTF 导出,请告诉我如何做到这一点。

In stackoverflow.com I have found a question where a user was suggesting to use this libraries of KDE in order to export-inport RTF files. But, when I downloaded I saw that there are lot of files that are included in the .cc and .h files that are missing. So please give a hint how to download all necessary files and is there any guide that gives and example how to use the RTF exporting example(or instructions)?

BTW if you have ever done RTF exporting programmatically in a better way, please tell me how I can do that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮邮递员 2024-09-15 15:03:28

首先,正如您提到的,该代码是 KDE 项目的一部分。它的代码库非常大,因此在最坏的情况下您必须提供大部分 kdebase-dev。以下链接包含从 SVN 构建 KWord 的教程,它将引入您需要的所有依赖项(然后您可以开始删除它们,因为您发现它们不相关):

http://wiki.koffice.org/index.php?title=Build_KOffice

浏览源代码,我注意到一些事情。

  • #include 几乎只是引用 QObject,因此请确保安装了 Qt。
  • 您正在寻找的 RTF 类似乎是 KDE 对象的子类。这意味着如果您不能将 KDE 作为项目的依赖项,您可能需要进行大量工作才能将基本代码与 KDE 分离。

编辑:例如,看起来您可能可以从 ExportFilter.cc 中提取大部分算法,并根据您的需要进行修改。看起来大部分工作是通过 QString 而不是 KDE 方法完成的。

First off, as you mention, that code is part of the KDE project. Its code base is very large, so in the worst case you'd have to provide most of kdebase-dev. The following link contains a tutorial for building KWord from SVN, which will pull in all the dependencies you need (then you can start deleting them as you find they aren't relevant):

http://wiki.koffice.org/index.php?title=Build_KOffice

Browsing the sources, I note a few things.

  • The #includes pretty much just reference QObjects, so be sure that Qt is installed.
  • The RTF classes you're looking for seem to subclass KDE objects. This means you may have to go through significant work to separate the base code from KDE if you can't have KDE as a dependency for your project.

edit: Looks like you could probably pull much of the algorithm from ExportFilter.cc, for example, and modify it to your needs. Looks like much of the work is being done via QString rather than KDE methonds.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文