Qt 5.6 | QDoc Manual | Document Structure

Qt 5.6.3 Reference Documentation

Text Markup ◦ Including Code Inline

# Document Structure

The document structuring commands are for dividing your document into sections. QDoc supports six kinds of sections: `\part`, `\chapter`, `\section1`, `\section2`, `\section3`, and `\section4`. The `\section1..4` commands are the most useful. They correspond to the traditional section, subsection, etc used in outlining.

## \part

The \part command is intended for use in a large document, like a book.

In general a document structuring command considers everything that follows it until the first line break as its argument. The argument is rendered as the unit's title. If the title needs to be spanned over several lines, make sure that each line (except the last one) is ended with a backslash.

In total, there are six levels of sections in QDoc: `\part`, `\chapter`, `\section1`, `\section2`, `\section3` and `\section4`. `\section1` to `\section4` correspond to the traditional section, subsection, subsubsection and subsubsubsection.

There is a strict ordering of the section units:

      part
         |
         chapter
               |
               section1
                      |
                      section2
                             |
                             section3
                                    |
                                    section4

For example, a `section1` unit can only appear as the top level section or inside a `chapter` unit. Skipping a section unit, for example from `part` to `section1`, is not allowed.

You can begin with either of the three: `part`, `chapter` or `section1`.

      / *!
          \part Basic Qt

          This is the first part.

              \chapter Getting Started

              This is the first part's first chapter.

                  \section1 Hello Qt

                  This is the first chapter's first section.

                  \section1 Making Connections

                  This is the first chapter's second section.

                  \section1 Using the Reference Documentation

                  This is the first chapter's third section.

              \chapter Creating Dialogs

              This is the first part's second chapter.

                  \section1 Subclassing QDialog

                  This is the second chapter's first section.

                  ...

          \part Intermediate Qt

          This is the second part.

              \chapter Layout Management

              This is the second part's first chapter.

                  \section1 Basic Layouts

                  This is the first chapter's first section.

          ...
      * /

QDoc renders this as:

> # Basic Qt

> This is the first part.

> ## Getting Started

> This is the first part's first chapter.

> ### Hello Qt

> This is the first chapter's first section.

> ### Making Connections

> This is the first chapter's second section.

> ### Using the Reference Documentation

> This is the first chapter's third section.

> ## Creating Dialogs

> This is the first part's second chapter.

> ### Subclassing QDialog

> This is the second chapter's first section.

> ...

> # Intermediate Qt

> This is the second part.

> ## Layout Management

> This is the second part's first chapter.

> ### Basic Layouts

> This is the first chapter's first section.

> ...

Each section is a logical unit in the document. The section heading appears in the automatically generated table of contents that normally appears in the upper right-hand corner of the page.

## \chapter

The \chapter command is intended for use in larger documents, and divides the document into chapters.

See \part for an explanation of the various section units, command argument, and rendering.

## \section1

The \section1 command starts a new section.

See \part for an explanation of the various section units, command argument, and rendering.

## \section2

The \section2 command starts a new section.

See \part for an explanation of the various section units, command argument, and rendering.

## \section3

The \section3 command starts a new section.

See \part for an explanation of the various section units, command argument, and rendering.

## \section4

The \section4 command starts a new section.

See \part for an explanation of the various section units, command argument, and rendering.