• C++ Classes
  • Test
  • 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 2.0
    Inherited By:

    TestQDoc::TestDerived

    Public Types

    enum ClassicEnum { Yee, Haw, Howdy, Partner }
    enum class ScopedEnum { This, That, All }
    SomeType

    Public Functions

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

    Protected Functions

    void overload()
    void overload(bool b)
    bool operator==(const TestQDoc::Test &lhs, const TestQDoc::Test &rhs)

    Macros

    QDOCTEST_MACRO2(int &x)

    Detailed Description

    Member Type Documentation

    enum Test::ClassicEnum

    ConstantValue
    TestQDoc::Test::Yee0
    TestQDoc::Test::Haw1
    TestQDoc::Test::Howdy2
    TestQDoc::Test::Partner3

    enum class Test::ScopedEnum

    This enum has a brief to trigger a bug in CMD_BRIEF.

    ConstantValueDescription
    TestQDoc::Test::ScopedEnum::This0x01Something
    TestQDoc::Test::ScopedEnum::That0x02Something else
    TestQDoc::Test::ScopedEnum::All (since Qt 2.0)This | ThatEverything

    A scoped enum.

    Test::SomeType

    A typedef.

    Member Function Documentation

    [protected] void Test::overload()

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

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

    [noexcept default] Test::Test()

    Default constructor.

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

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

    void Test::inlineFunction()

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

    void Test::methodWithEmDashInItsDocs()

    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()

    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.

    int Test::someFunction(int, int v = 0)

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

    void Test::someFunctionDefaultArg(int i, bool b = false)

    Function that takes a parameter i and b.

    [virtual] void Test::virtualFun()

    Function that must be reimplemented.

    [noexcept default] TestQDoc::Test &Test::operator=(TestQDoc::Test &&other)

    Move-assigns other.

    Related Non-Members

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

    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.