物事の関連付け
関連コマンドは、ある文書化された要素が別の文書化された要素とどのように関連するかを指定するためのものです。いくつかの例があります:
- この関数は他の関数のオーバーロードである。
- この関数は他の関数の再実装である。
- このtypedefはあるクラスやヘッダーファイルと関連している。
QMLの型が他のQMLの型を継承していることを示すコマンドもあります。
コマンド
\継承
あるQML型が他のQML型を継承していることを示すコマンドです。このコマンドは、継承されるエレメントの 〚QMLtype〛コメントの中に含まれていなければなりません。引数は継承されるQML型の名前です。
/*! \qmltype PauseAnimation \nativetype QDeclarativePauseAnimation \ingroup qml-animation-transition \since 4.7 \inherits Animation \brief The PauseAnimation element provides a pause for an animation. When used in a SequentialAnimation, PauseAnimation is a step when nothing happens, for a specified duration. A 500ms animation sequence, with a 100ms pause between two animations: SequentialAnimation { NumberAnimation { ... duration: 200 } PauseAnimation { duration: 100 } NumberAnimation { ... duration: 200 } } \sa {QML Animation and Transitions}, {declarative/animation/basics}{Animation basics example} */
QDoc はこの行をPauseAnimation 要素のリファレンス・ページに含めます:
\オーバーロード
関数がその名前の二次オーバーロードであることを示すためのコマンドです。
このコマンドはそれ自身の行に立っていなければなりません。
オーバーロードされた関数名(コンストラクタを除く)に対して、QDocはその関数の一次バージョ ンを1つ、それ以外のすべてのバージョンに "overload "コマンドを付けることを期待します。プライマリ・バージョンは完全に文書化されている必要があります。各オーバーロードは、そのオーバーロードされたバージョンだけのために追加したい余分なドキュメントを持つことができます。
このコマンドは、関数のプライマリバージョンのドキュメントへのリンクを持つ標準的なThis function overloads...行のテキストを含めます。
/*! \overload addAction() This convenience function creates a new action with an \a icon and some \a text. The function adds the newly created action to the menu's list of actions, and returns it. \sa QWidget::addAction() */ QAction *QMenu::addAction(const QIcon &icon, const QString &text) { QAction *ret = new QAction(icon, text, this); addAction(ret); return ret; }
もし関数名をoverloadコマンドに含めなければ、"This function overloads... "行と主要バージョンのドキュメントへのリンクの代わりに、古い標準的な行が表示されます:
これはオーバーロードされたメンバ関数です。
.
\レインプ
関数が仮想関数の再実装であることを示すためのコマンドです。
このコマンドはそれ自身の行に立っていなければなりません。
QDocはクラス参照から再実装関数を省略します。
/*! \reimp */ void QToolButton::nextCheckState() { Q_D(QToolButton); if (!d->defaultAction) QAbstractButton::nextCheckState(); else d->defaultAction->trigger(); }
この関数はドキュメントには含まれません。代わりに、ベース関数QAbstractButton::nextCheckState() へのリンクがドキュメントに表示されます。
\関連
relationates "コマンドは、クラス、ネームスペース、またはヘッダー・ファイルに対する実 体(関数、マクロ、typedef、enum、または変数)のドキュメントを含めるためのものです。引数は、実体が関連するクラス、ネームスペース、またはヘッダーの名前です。
引数がテンプレート化された型を参照する場合は、型名のみを使用します(テンプレート・パラメータは使用しません)。
/*! \relates QChar Reads a char from the stream \a in into char \a chr. \sa {Format of the QDataStream operators} */ QDataStream &operator>>(QDataStream &in, QChar &chr) { quint16 u; in >> u; chr.unicode() = ushort(u); return in; }
この関数のドキュメントは、関連する非会員セクションにあるクラスQChar のリファレンス・ページにあります。
© 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.