- Qt 5.15
- QDoc Manual
- Document Structure
- Qt 5.15.19 Reference Documentation

Text Markup ◦ Including Code Inline

# Document Structure

The document structuring commands are for dividing your document into sections. QDoc supports four levels of section: `\section1`, `\section2`, `\section3`, and `\section4`. The section commands correspond to the traditional section, subsection, etc used in outlining.

## Section commands

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 four levels for sections in QDoc: `\section1`, `\section2`, `\section3` and `\section4`. These correspond to the traditional section, subsection, subsubsection and subsubsubsection.

There is a strict ordering of the section units:

     section1
            |
            section2
                   |
                   section3
                          |
                          section4

When sections are used, the first section command should be `section1`.

     / *!
         \section1 Basic Qt

         This is the first section.

             \section2 Getting Started

             This is the first subsection.

                 \section3 Hello Qt

                 This is the first subsubsection.

                 \section3 Making Connections

                 This is the second subsubsection.

                 \section3 Using the Reference Documentation

                 This is the third subsubsection.

             \section2 Creating Dialogs

             This is the second subsection.

                 \section3 Subclassing QDialog

                 This is the first subsubsection.

                 ...

         \section1 Intermediate Qt

         This is the second section.

             \section2 Layout Management

             This is the second section's first subsection.

                 \section3 Basic Layouts

                 This is the first subsubsection.

         ...
     * /

QDoc renders this as:

> # Basic Qt

> This is the first section.

> ## Getting Started

> This is the first subsection.

> ### Hello Qt

> This is the first subsubsection.

> ### Making Connections

> This is the second subsubsection.

> ### Using the Reference Documentation

> This is the third subsubsection.

> ## Creating Dialogs

> This is the second subsection.

> ### Subclassing QDialog

> This is the first subsubsection.

> ...

> # Intermediate Qt

> This is the second section.

> ## Layout Management

> This is the second section's first subsection.

> ### Basic Layouts

> This is the first subsubsection.

> ...

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.

## \section1

The \section1 command starts a new section.

See Section commands for an explanation of the various section units, command argument, and rendering.

## \section2

The \section2 command starts a new section.

See Section commands for an explanation of the various section units, command argument, and rendering.

## \section3

The \section3 command starts a new section.

See Section commands for an explanation of the various section units, command argument, and rendering.

## \section4

The \section4 command starts a new section.

See Section commands for an explanation of the various section units, command argument, and rendering.