文件导航
导航命令用于以有意义的顺序链接文档页面。下面是 QDoc 注释序列,显示了导航命令的典型用法。
示例
/*! \page basicqt.html \nextpage Getting Started \indexpage Index \startpage Basic Qt \title Basic Qt The Qt toolkit is a C++ class library and a set of tools for building multiplatform GUI programs using a "write once, compile anywhere approach". Table of contents: \list \li \l {Getting Started} \li \l {Creating Dialogs} \li \l {Creating Main Windows} \endlist */ /*! \page gettingstarted.html \previouspage Basic Qt \nextpage Creating Dialogs \indexpage Index \startpage Basic Qt \title Getting Started This chapter shows how to combine basic C++ with the functionality provided by Qt to create a few small graphical interface (GUI) applications. */ / *! \page creatingdialogs.html \previouspage Getting Started \indexpage Index \startpage Basic Qt \title Creating Dialogs This chapter will teach you how to create dialog boxes using Qt. */ /*! \page index.html \indexpage Index \startpage Basic Qt \title Index \list \li \l {Basic Qt} \li \l {Creating Dialogs} \li \l {Getting Started} \endlist */
startpage命令创建了一个链接,指向作者希望作为多页文档首页的页面。
该链接包含在生成的 HTML 源代码中,但对文档没有视觉效果:
<head> ... <link rel="start" href="basicqt.html" /> ... </head>
命令
\上一页
previouspage(上一页)命令将当前页链接到前一页。该命令有两个参数,每个参数都用大括号括起来:第一个参数是链接目标(前一页的标题),第二个参数是链接文本。如果页面标题等同于链接文本,则第二个参数可以省略。
该命令必须独立成行。
\下一页
nextpage命令将当前页链接到下一页。该命令的语法和参数约定与\previouspage命令相同。
\开始页
startpage命令用于指定一个页面序列的第一页。该命令必须独立成行,其唯一参数是第一个文档的标题。
QDoc 将生成一个指向起始页的链接,并将其包含在生成的 HTML 文件中,但这对文档没有任何视觉效果。生成的链接类型会告诉浏览器和搜索引擎,作者认为哪个文档是文档集的起点。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.