特殊内容

文档内容命令标识了文档的部分,具有特殊渲染、概念意义或功能的部分。

\quotation

\quotation 和 \endquotation 命令界定了一条长引用。

界定块中的文本在 HTML 输出中由 <blockquote></blockquote> 包围,例如。

/*!
  Although the prospect of a significantly broader market is
  good news for Firstlogic, the notion also posed some
  challenges. Dave Dobson, director of technology for the La
  Crosse, Wisconsin-based company, said:

  \quotation
     As our solutions were being adopted into new
     environments, we saw an escalating need for easier
     integration with a wider range of enterprise
     applications.
  \endquotation
*/

\quotation 块中的文本将在生成的 HTML 中显示为

<blockquote>
  <p>As our solutions were being adopted into new environments,
  we saw an escalating need for easier integration with a wider
  range of enterprise applications.</p>
</blockquote>

大多数浏览器的内建样式表将使用左右缩进渲染 <blockquote> 标签的内容。上面的示例将呈现为

随着我们解决方案被应用于新的环境,我们看到了越来越需要与更广泛的企业应用程序更轻松集成的需求。

但您可以在 style.css 文件中重新定义 <blockquote> 标签。

\footnote

\footnote 和 \endfootnote 命令界定了一个脚注。

脚注渲染在页面底部。

警告: \footnote 和 \endfootnote 命令尚未实现。脚注将作为常规 HTML 段落渲染。

\note

\note 命令定义了一个以粗体“注意:”开头的新段落。

\tableofcontents

\tableofcontents 命令已被禁用,因为 QDoc 现在将自动生成目录。

自动生成的目录出现在页面的右上角。

\brief

\brief 命令介绍了 主题命令 之一的单句描述。

简要文本用于介绍相关对象的文档,并在使用 \generatelist 命令和 \annotatedlist 命令生成的列表中。

简要文本将在特定主题的文档中显示。

例如布尔 QWidget::isWindow 属性

/*!
   \property QWidget::isActiveWindow
   \brief Whether this widget's window is the active window.

   The active window is the window that contains the widget that
   has keyboard focus.

   When popup windows are visible, this property is \c true
   for both the active window \e and the popup.

   \sa activateWindow(), QApplication::activeWindow()
*/

QWidget::geometry 属性

/*!
   \property QWidget::geometry
   \brief The geometry of the widget relative to its parent and
   excluding the window frame.

   When changing the geometry, the widget, if visible,
   receives a move event (moveEvent()) and/or a resize
   event (resizeEvent()) immediately.

   ...

  \sa frameGeometry(), rect(), ...
*/

当使用 \brief 命令描述类时,我们建议使用这个完整的句子

The <classname> class is|provides|contains|specifies...

警告: 不要与详细描述使用相同的句子重复您的详情描述,因为简要声明将是详细描述的第一段。

/*!
   \class PreviewWindow
   \brief The PreviewWindow class is a custom widget
          displaying the names of its currently set
          window flags in a read-only text editor.

   The PreviewWindow class inherits QWidget. The widget
   displays the names of its window flags set with the
   setWindowFlags() function. It is also provided with a
   QPushButton that closes the window.

   ...

   \sa QWidget
*/

\namespace 中使用 \brief

/*!
   \namespace Qt

   \brief The Qt namespace contains miscellaneous identifiers
   used throughout the Qt library.
*/

\headerfile 中使用 \brief

/*!
   \headerfile <QtGlobal>
   \title Global Qt Declarations

   \brief The <QtGlobal> header file provides basic
   declarations and is included by all other Qt headers.

   \sa <QtAlgorithms>
*/

另请参阅 \property\class\namespace\headerfile

\legalese

\legalese 和 \endlegalese 命令可以界定许可证协议。

在生成的 HTML 中,被界定的文本会被 <div class="LegaleseLeft"></div> 标签包围。

一个示例许可证协议包含在 \legalese 和 \endlegalese 中

/*!
    \legalese
        Copyright 1996 Daniel Dardailler.

        Permission to use, copy, modify, distribute, and sell this
        software for any purpose is hereby granted without fee,
        provided that the above copyright notice appear in all
        copies and that both that copyright notice and this
        permission notice appear in supporting documentation, and
        that the name of Daniel Dardailler not be used in
        advertising or publicity pertaining to distribution of the
        software without specific, written prior permission. Daniel
        Dardailler makes no representations about the suitability of
        this software for any purpose. It is provided "as is"
        without express or implied warranty.

        Modifications Copyright 1999 Matt Koss, under the same
        license as above.
    \endlegalese
*/

在生成的 HTML 中将显示为

<div class="LegaleseLeft">
   <p>Copyright 1996 Daniel Dardailler.</p>
   <p>Permission to use, copy, modify, distribute, and sell
   this software for any purpose is hereby granted without fee,
   provided that the above copyright notice appear in all
   copies and that both that copyright notice and this
   permission notice appear in supporting documentation, and
   that the name of Daniel Dardailler not be used in
   advertising or publicity pertaining to distribution of the
   software without specific, written prior permission. Daniel
   Dardailler makes no representations about the suitability of
   this software for any purpose. It is provided "as is"
   without express or implied warranty.</p>

   <p>Modifications Copyright 1999 Matt Koss, under the same
   license as above.</p>
</div>

如果省略 \endlegalese 命令,QDoc 将处理 \legalese 命令,但将文档页面的其余部分视为许可证协议。

理想情况下,许可证文本应位于授予权的代码旁边。

在其他地方,使用带有 legalese 作为参数的 \generatelist 命令可以累积标识为 \legalese 的文档。这对于生成与源代码相关的许可证协议概览很有用。

注意: \generatelist legalese 命令的输出仅包括当前文档项目中的 \legalese 文本。如果当前文档项目依赖于其他模块,它们的许可证文本将不会列出。

\warning

\warning 命令将 "警告:" 前置于命令的参数,并使用粗体字体。

/*!
   Qt::HANDLE is a platform-specific handle type
   for system objects. This is  equivalent to
   \c{void *} on Windows and macOS, and to
   \c{unsigned long} on X11.

   \warning Using this type is not portable.
*/

© 2024 Qt 公司有限。此处包含的文档贡献的版权属于其各自的所有者。此处提供的文档是根据自由软件基金会公布的 GNU 自由文档许可证第 1.3 版 条款授权的。Qt 和相应的标志是芬兰以及/或世界其他国家的 The Qt Company Ltd. 的商标。所有其他商标均为其各自所有者的财产。