このページでは

タブコンテンツ

以下のマクロを使用して、同等または代替のコンテンツを持つラベル付き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}

指定したタブ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.