タブ形式のコンテンツ
以下のマクロを使用すると、類似したコンテンツや代替コンテンツを含む、ラベル付きのHTMLタブからなるタブグループを作成できます。たとえば、さまざまなプログラミング言語のコードスニペットを表示することができます。
タブマクロの使用方法
\tab {name}{tab-id}{title}{checked}
\tabcontent {tab-id}
content
\endtabcontent注:これらの マクロはオンラインテンプレートおよびDocBookでのみ機能するため、オフラインヘルプでも適切な結果を得るには、通常、条件付きテキストを使用する必要があります。
たとえば、CMake および qmake ビルドシステムに関する説明をタブで表示するには、次のようにします。
\if defined(onlinedocs)
\tab {build-qt-app}{tab-cmake}{CMake}{checked}
\tab {build-qt-app}{tab-qmake}{qmake}{}
\tabcontent {tab-cmake}
\else
\section1 Using CMake
\endif
CMake-specific instructions go here
\if defined(onlinedocs)
\endtabcontent
\tabcontent {tab-qmake}
\else
\section1 Using qmake
\endif
qmake-specific instructions go here
\if defined(onlinedocs)
\endtabcontent
\endif\tab
\tab {name}{tab-id}{title}{checked}タブグループ内のタブを、名前、ID、タイトル、およびデフォルトの状態を指定して定義します。
どのタブがタブグループに属するかを指定するには、一意の名前を使用します。つまり、グループ内のすべてのタブは同じ名前を持ちます。タブ同士を区別するには、グループ内で各タブに一意のタブIDを割り当ててください。このタブIDを \tabcontent マクロの値として使用し、タブにコンテンツを追加します。
checked引数を指定すると、HTMLページが読み込まれた際に、そのタブがデフォルトで選択されます。初期状態で非表示にするタブについては、空の引数 {} を指定してください。
\tabcontent
\tabcontent {tab-id}指定したtab-idを持つタブにコンテンツを追加します。
\endtabcontent
\tabcontent で始まるタブコンテンツの終了位置を指定します。
「マクロ」も参照してください 。
© 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.