画像を含む
グラフィック・コマンドを使用すると、ドキュメントに画像を含めることができます。画像は独立した段落として、または実行中のテキスト内に表示することができます。
\画像
imageコマンドは、最初の引数で指定された画像に展開し、別の段落として中央に配置します。
このコマンドは2つの引数を取ります。最初の引数は画像ファイルの名前です。番目の引数は、画像の内容の説明で、HTMLのalt
属性に使用されます。その内容はスクリーンリーダーによって音声で読み上げられるので、アクセシビリティの目的で使用することが強く推奨されます。また、テキスト・ブラウザのLynxのように、画像をサポートしていないブラウザでも使うことができます。usealttextastitle変数を設定して、QDocに画像のtitle属性を生成させることもできます。
QDocはかなり寛容ですが、ファイル名と説明文の両方を中かっこで囲む必要があります:
\image {Bandit.png} {A Golden Retriever holding a bag of coffee in its mouth}
この構文は最も明示的で、常に期待通りの結果が得られるはずです。そうでない場合は、必ずファイル名か説明文の後に改行を入れてください。説明の引数が複数行にまたがる場合は、中括弧が必要である。記述が二重引用符で囲まれている場合、QDocは出力を生成する前に二重引用符を削除します。特殊文字はQDocのHTML出力で対応するHTMLエンティティコードに置き換えられるかもしれません。
/*! Qt is a C++ toolkit for cross-platform GUI application development. \image {happyguy.jpg} {Happy guy} Qt provides single-source portability across Microsoft Windows, macOS, Linux, and all major commercial Unix variants. It is also available for embedded devices. */
また、"caption "と "inlineimage "も参照してください。
\インライン画像
lineimageコマンドは、引数で指定された画像に展開されます。画像はテキストの残りの部分とインラインでレンダリングされます。
コマンドは2つの引数を取る。最初の引数は画像ファイルの名前です。2番目の引数はオプションで、中括弧{}内に画像の簡単な説明を記述します。この説明はツールチップや、Lynxテキストブラウザのようにブラウザが画像をサポートしていない場合に使用されます。
インライン画像コマンドの最も一般的な使い方は、リストと表です。以下は、リストにインライン画像を含める例です:
/*! \list 1 \li \inlineimage happy.gif {Oh so happy, I am a caption!} \li \inlineimage happy.gif Oh so happy, but I'm not a caption. \endlist */
インライン画像を表に含める例です:
/*! \table \header \li Qt \li Qt Creator \row \li \inlineimage happy.gif {Oh so happy!} \li \inlineimage happy.gif Oh so happy! \row \li \inlineimage happy.gif Oh so happy! \li \inlineimage happy.gif {Oh so happy!} \endtable */
このコマンドは、テキストに画像をインラインで挿入するためにも使えます。
/*! \inlineimage training.jpg {Qt Training} The Qt Programming course is offered as a five day Open Enrollment Course. The classes are open to the public. Although the course is open to anyone who wants to learn, attendees should have significant experience in C++ development to derive maximum benefit from the course. */
\キャプション
を参照してください。
このコマンドは段落の最後までの全てのテキストをキャプションにします。お望みの効果が得られるまで試してみてください。
/*! \table 100% \row \li \image windows-pushbutton.png \caption The QPushButton widget provides a command button. \li \image windows-toolbutton.png \caption The QToolButton class provides a quick-access button to commands or options, usually used inside a QToolBar. \endtable */
を参照してください。
© 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.