Building Qt Documentation/zh

From Qt Wiki
Jump to navigation Jump to search
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

简体中文 English Русский Italiano Spanish 日本語


构建 Qt 文档

关于如何为Qt编写文档的信息,访问页面 编写Qt文档

要寻求对文档构建过程中的疑难处理的帮助,请访问页面 Qt文档疑难排除

构建 qdoc3

qdoc3 在 Qt 的常规构建过程中会被构建,因为需要用它来生成Qt的文档。这意味着,对多数开发者,qdoc3 已经伴随着Qt的其他工具被安装了。

运行 qdoc3

有两种构建 Qt 文档的方式。

使用 Qt 的构建系统

在命令行中,进入构建树(build tree)的根目录并调用 docs 构建命令。

比如,在 Linux/Unix 平台:

cd path/to/qt-build
make docs

在 Windows 下,你可能需要使用本地的 nmake (或mingw32-make)工具:

cd path\to\qt-build
nmake docs

直接运行 qdoc3

如果你的 qdoc3 已被构建,你可以直接运行它来生成文档。

在命令行中,设置环境变量 QT_SOURCE_TREEQT_BUILD_TREE 来指示源码树和构建树的跟目录。然后进入构建树的根目录并执行 qdoc3。

比如,在 Linux/Unix 平台:

cd path/to/qt-build
QT_SOURCE_TREE=path/to/qt-source QT_BUILD_TREE=path/to/qt-build ./bin/qdoc3 path/to/qt-source/tools/qdoc3/test/qt-build-docs.qdocconf

这将会生成离线文档。要创建在线风格的文档,在配置文件 qt-build-docs-online.qdocconf 上运行 qdoc3

使用最小的Qt来构建 qdoc3

理想情况下,使用一个简单的构建规则来构建 qdoc3 需要的最小的 Qt 库的集合是可能的。尽管如此,目前需要调用一些需要的Qt库的构建规则来构建 qdoc3 (fix me)。在构建树的根目录下,调用下面的命令。

在 Linux/Unix 平台:

make sub-tools-bootstrap sub-moc sub-corelib sub-xml sub-qdoc3

在 Windows 下:

nmake sub-tools-bootstrap sub-moc sub-corelib sub-xml sub-qdoc3