TestQDoc::Test Class | Qt 6.2.11
Description: A class in a namespace.

# TestQDoc::Test Class

class TestQDoc::Test

A class in a namespace. More...

Header: | `#include <Test>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS QDocTest)` `target_link_libraries(mytarget PRIVATE Qt6::QDocTest)`
qmake: | `QT += testcpp`
Since: | Qt 1.1
In QML: | Type
Inherited By: | TestQDoc::TestDerived

- List of all members, including inherited members
- Deprecated members
- Test is part of Test C++ Types.

Note: All functions in this class are reentrant with the following exceptions:

- someFunctionDefaultArg(int i, bool b) const

## Public Types

enum | Admonitions { NoteInValue, WarningInValue, ImportantInValue, MultipleAdmonitions, MultipleNotes }
| SomeType

## Public Functions

| Test()
void (*)(bool) | funcPtr(bool b, const char *s)
void | inlineFunction()
void | methodWithEmDashInItsDocs()
void | methodWithEnDashInItsDocs()
`(since Test 1.0)` int | someFunction(int, int v = 0)
`(since 2.0)` void | someFunctionDefaultArg(int i, bool b = false) const
virtual void | virtualFun()
TestQDoc::Test & | operator=(TestQDoc::Test &&other)

## Protected Functions

void | overload()
`(since Test 1.2)` void | overload(bool b)

## Related Non-Members

bool | operator==(const TestQDoc::Test &lhs, const TestQDoc::Test &rhs)

## Macros

`(since Test 1.1)` | QDOCTEST_MACRO2(int &x)

## Detailed Description

## Member Type Documentation

### enum Test::Admonitions(source)

Enum to exercise admonition commands within \value descriptions.

Constant | Value | Description
--- | --- | ---
`TestQDoc::Test::NoteInValue` | `0` | A value with a note. Note: This note should remain inside the value description.
`TestQDoc::Test::WarningInValue` | `1` | A value with a warning. Warning: This warning should remain inside the value description.
`TestQDoc::Test::ImportantInValue` | `2` | A value with an important notice. Important: This important notice should remain inside the value description.
`TestQDoc::Test::MultipleAdmonitions` | `3` | A value with multiple admonitions. Note: First admonition in this value. Warning: Second admonition in the same value.
`TestQDoc::Test::MultipleNotes` | `4` | A value with multiple notes, as in the WindowStaysOnBottomHint documentation for Qt::WindowType. Note: First note for this value. Note: Second note for this value.

### Test::SomeType(source)

A typedef.

## Member Function Documentation

### Test::Test()(source)

The constructor is deleted.

### void (*)(bool) Test::funcPtr(bool b, const char *s)(source)

Returns a pointer to a function that takes a boolean. Uses b and s.

### void Test::inlineFunction()(source)

An inline function, documented using the \fn QDoc command.

### void Test::methodWithEmDashInItsDocs()(source)

This method has em dashes in its documentation—as you'll find represented by `---` in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash.

-----------------------------------------------------------------------

People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes.

—You can also start a new paragraph with an em dash, if you want to.

See also methodWithEnDashInItsDocs.

### void Test::methodWithEnDashInItsDocs()(source)

This method has en dashes in its documentation – as you'll find represented by `--` in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked:

    for (int i = 42; i > 0; --i)
        // Do something cool during countdown.

...as it would be silly if this would output –i instead of `--i`.

-----------------------------------------------------------------------

It still allows people to add a bunch of dashes, though, without replacing them all with a series of en dashes. Of course, they might want to use the \hr command instead, like this:

– You can also start a new paragraph with an en dash, if you want to.

See also methodWithEnDashInItsDocs.

### `[protected]` void Test::overload()(source)

### `[protected, since Test 1.2]` void Test::overload(bool b)(source)

Overloads that share a documentation comment, optionally taking a parameter b.

### `[since Test 1.0]` int Test::someFunction(int, int v = 0)(source)

Function that takes a parameter v. Also returns the value of v.

This function was introduced in Test 1.0.

### `[since 2.0]` void Test::someFunctionDefaultArg(int i, bool b = false) const(source)

Function that takes a parameter i and b.

Warning: This function is not reentrant.

This function was introduced in Qt 2.0.

### `[virtual]` void Test::virtualFun()(source)

Function that must be reimplemented.

### TestQDoc::Test &Test::operator=(TestQDoc::Test &&other)(source)

The move assignment operator is deleted. other cannot be moved from.

## Related Non-Members

### bool operator==(const TestQDoc::Test &lhs, const TestQDoc::Test &rhs)(source)

Returns true if lhs and rhs are equal.

## Macro Documentation

### `[since Test 1.1]` QDOCTEST_MACRO2(int &x)

A macro with argument x.

This macro was introduced in Test 1.1.