ドキュメントナビゲーション
ナビゲーション・コマンドはドキュメントのページを意味のある順序でリンクするためのものです。以下はナビゲーション・コマンドの典型的な使い方を示す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
\previouspage コマンドは現在のページを前のページにリンクする。コマンドには2つの引数があり、それぞれ中括弧で囲まれている。1つ目はリンク先(前のページのタイトル)、2つ目はリンクテキストである。ページのタイトルがリンクテキストと同じであれば、2番目の引数は省略できます。
コマンドは1行で独立していなければならない。
\nextpage
\nextpage コマンドは、現在のページを次のページにリンクする。このコマンドは \previouspageコマンドと同じ構文と引数の規則に従う。
\startpage
\startpage コマンドは、一連のページの最初のページを指定する。このコマンドはそれ自身の行に単独で存在しなければならず、そのユニークな引数は最初の文書のタイトルである。
QDocは開始ページへのリンクを生成し、生成されたHTMLファイルに含めますが、ドキュメントに視覚的な効果はありません。生成されたリンクタイプはブラウザと検索エンジンに、どのドキュメントがコレクションの開始点であると作者が考えているかを伝えます。
\toc
\toc と\endtoc コマンドは、コマンドが現れるトピックのサブトピック (ページ) のリストを指定します。目次 (TOC) 階層は、各トピックの TOC エントリに基づいて、ドキュメント・プロジェクト全体に対して生成されます。
\toc...\endtoc ブロック内では \tocentryコマンドを使用して、サブトピックをタイトルで指定します。(リンク) \l(link)コマンドと同様に、\tocentry は、生成されるTOCエントリーのユーザーから見えるタイトルのオプションの第2引数を取ります。
/*!
\page index.html
\title Qt
...
\toc
\tocentry {Introduction to Qt} {Introduction}
\tocentry {What's new in Qt} {What's new}
\tocentry {Getting started}
\endtoc
*/\tocコマンドを入れ子にすることはできません。しかし、各サブトピックは独自のTOCエントリーを指定することができます。1つのトピックが使用できる\toc コマンドは1つだけです。
QDocは出来上がった目次構造をXML形式で<project>_toc.xmlファイルに書き込みます。
注意: ルート・トピック (インデックスまたはランディング・ページ) は、プロジェクト構成でnavigation.landingpage またはnavigation.homepage のいずれかで指定する必要があります。 navigationを参照してください。
\toc コマンドは Qt 6.11 で QDoc に導入されました。
以下も参照してください。 \tocentry.
\tocentry
目次の項目としてサブトピック(ページ)を指定する。\toc 、\endtoc のペアの中でしか使えない。
\tocentry コマンドは Qt 6.11 で QDoc に導入されました。
以下も参照してください。 \toc.
© 2026 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.