From c555d3493f52c378707a40d824d70f369e0b4db9 Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Tue, 11 Feb 2020 12:32:47 +0100 Subject: qdoc: Extend \include command to include exampledirs By default, qdoc supports \include files from the sourcedirs only. It should also consider files to \include from the exampledirs, like it does for the \snippet and \quotefromfile commands. In addition, added a test to check if the \include works for files exampledirs. Change-Id: I9ce0b1905bfd0413022a4b4cab42588e4540e70e Reviewed-by: Qt CI Bot Reviewed-by: Paul Wicking --- src/qdoc/config.cpp | 8 +- src/qdoc/doc/qdoc-manual-markupcmds.qdoc | 16 +- .../includefromexampledirs/index.html | 28 ++++ .../qdoc-test-qmlmodule.html | 23 +++ .../includefromexampledirs/qml-int.html | 23 +++ .../qml-qdoc-test-abstractparent-members.html | 18 ++ .../qml-qdoc-test-abstractparent.html | 79 +++++++++ .../qml-qdoc-test-child-members.html | 18 ++ .../qml-qdoc-test-child.html | 79 +++++++++ .../qml-qdoc-test-doctest-members.html | 18 ++ .../qml-qdoc-test-doctest.html | 86 ++++++++++ .../qml-qdoc-test-type-members.html | 31 ++++ .../includefromexampledirs/qml-qdoc-test-type.html | 185 +++++++++++++++++++++ .../includefromexampledirs/test.index | 75 +++++++++ .../includefromexampledirs/testcpp-module.html | 42 +++++ .../testqdoc-test-members.html | 22 +++ .../testqdoc-test-obsolete.html | 36 ++++ .../includefromexampledirs/testqdoc-test.html | 91 ++++++++++ .../testqdoc-testderived-members.html | 22 +++ .../testqdoc-testderived.html | 48 ++++++ .../includefromexampledirs/testqdoc.html | 64 +++++++ .../excludes/anotherindex.qdoc | 39 +++++ .../excludes/parentinclude.qdoc | 64 +++++++ .../includefromexampledirs.qdocconf | 12 ++ .../src/includefromparent.qdoc | 51 ++++++ .../includefromexampledirs/src/parent.qdocinc | 1 + .../qdoc/generatedoutput/tst_generatedoutput.cpp | 8 + 27 files changed, 1177 insertions(+), 10 deletions(-) create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qdoc-test-qmlmodule.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-int.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent-members.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child-members.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest-members.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type-members.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/test.index create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testcpp-module.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-members.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-obsolete.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived-members.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived.html create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc.html create mode 100644 tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/anotherindex.qdoc create mode 100644 tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/parentinclude.qdoc create mode 100644 tests/auto/qdoc/generatedoutput/includefromexampledirs/includefromexampledirs.qdocconf create mode 100644 tests/auto/qdoc/generatedoutput/includefromexampledirs/src/includefromparent.qdoc create mode 100644 tests/auto/qdoc/generatedoutput/includefromexampledirs/src/parent.qdocinc diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp index 55a23610b..934958910 100644 --- a/src/qdoc/config.cpp +++ b/src/qdoc/config.cpp @@ -724,8 +724,12 @@ QString Config::getIncludeFilePath(const QString &fileName) const if (!includeFilesMap_.contains(ext)) { QSet t; QStringList result; - const QStringList dirs = getCanonicalPathList(CONFIG_SOURCEDIRS); - for (const auto &dir : dirs) + const auto sourceDirs = getCanonicalPathList(CONFIG_SOURCEDIRS); + for (const auto &dir : sourceDirs) + result += getFilesHere(dir, ext, location(), t, t); + // Append the include files from the exampledirs as well + const auto exampleDirs = getCanonicalPathList(CONFIG_EXAMPLEDIRS); + for (const auto &dir : exampleDirs) result += getFilesHere(dir, ext, location(), t, t); includeFilesMap_.insert(ext, result); } diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 51aa3c2cc..fb178c7cc 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -3725,16 +3725,16 @@ The command is useful when some snippet of commands or text is to be used in multiple places in the documentation. Use the \\include command wherever you want to insert a snippet into the documentation. - The file containing the snippet to include must be located under the - path(s) listed in the \l{sourcedirs-variable}{sourcedirs} QDoc - configuration variable. It can be either any source file parsed - by QDoc (or even the same one where \\include command is used), or - any other text file. To store snippets in a separate file that is - not meant to be parsed by QDoc, use a file extension that is not - listed in \l {sources.fileextensions-variable}{sources.fileextensions}; + The file containing the snippet to include, must be located under the + path(s) listed in the \l{sourcedirs-variable}{sourcedirs} or + \l{exampledirs-variable}{exampledirs} QDoc configuration variable. + It can be either any source file parsed by QDoc (or even the same one + where \\include command is used), or any other text file. To store + snippets in a separate file that is not meant to be parsed by QDoc, + use a file extension that is not listed in + \l{sources.fileextensions-variable}{sources.fileextensions}; for example, \c .qdocinc. - The command can have either one or two arguments. The first argument is always a file name. The contents of the file must be QDoc input, in other words, a sequence of QDoc commands and text, but diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html new file mode 100644 index 000000000..d1fb02484 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html @@ -0,0 +1,28 @@ + + + + + + doc index | Test + + +

doc index

+ + +
+ +

C++ Classes

+
+ + +

TestQDoc::Test

A class in a namespace

TestQDoc::TestDerived

A derived class in a namespace

+ +

QML Types

+
+ +

AbstractParent

Abstract base QML type

+

Test include file that is part of the sourcedirs.

+
+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qdoc-test-qmlmodule.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qdoc-test-qmlmodule.html new file mode 100644 index 000000000..6a513e987 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qdoc-test-qmlmodule.html @@ -0,0 +1,23 @@ + + + + + + Test + + + + + +
+
+ +
+ + + + + +

AbstractParent

Abstract base QML type

Child

A Child inheriting its parent

DocTest

Represents a doc test case

Type

A QML type documented in a .cpp file

int

An integer basic type

+ + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-int.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-int.html new file mode 100644 index 000000000..651f840cb --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-int.html @@ -0,0 +1,23 @@ + + + + + + int QML Basic Type | Test + + + +

int QML Basic Type

+ + +
+
+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent-members.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent-members.html new file mode 100644 index 000000000..48c8fa485 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent-members.html @@ -0,0 +1,18 @@ + + + + + + List of All Members for AbstractParent | Test + + + +

List of All Members for AbstractParent

+

This is the complete list of members for AbstractParent, including inherited members.

+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent.html new file mode 100644 index 000000000..cbb0f36aa --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-abstractparent.html @@ -0,0 +1,79 @@ + + + + + + AbstractParent QML Type | Test + + + +

AbstractParent QML Type

+ + +

Abstract base QML type. More...

+ +
+
Import Statement: import QDoc.Test 1.1
Inherited By:

Child

+
+ +

Properties

+ + +

Methods

+ + + +

Detailed Description

+ +

Property Documentation

+ +
+
+ + +

+[default] children : list<Child>

+

Children of the type.

+

Test include file that is part of the sourcedirs.

+
+
+

Method Documentation

+ +
+
+ + +

+void rear(child)

+

Do some abstract parenting on child.

+
+
+ +
+
+ + +

+void rear(child)

+

Do some abstract parenting on child.

+

Test include file that is part of the sourcedirs.

+
+
+ + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child-members.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child-members.html new file mode 100644 index 000000000..cedbad6bc --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child-members.html @@ -0,0 +1,18 @@ + + + + + + List of All Members for Child | Test + + + +

List of All Members for Child

+

This is the complete list of members for Child, including inherited members.

+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child.html new file mode 100644 index 000000000..b1775faa3 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-child.html @@ -0,0 +1,79 @@ + + + + + + Child QML Type | Test + + + +

Child QML Type

+ + +

A Child inheriting its parent. More...

+ +
+
Import Statement: import QDoc.Test 1.1
Inherits:

AbstractParent

+
+ +

Properties

+ + +

Methods

+ + + +

Detailed Description

+ +

Property Documentation

+ +
+
+ + +

+[default] children : list<Child>

+

Children of the type.

+

Test include file that is part of the sourcedirs.

+
+
+

Method Documentation

+ +
+
+ + +

+void rear(child)

+

Do some abstract parenting on child.

+
+
+ +
+
+ + +

+void rear(child)

+

Do some abstract parenting on child.

+

Test include file that is part of the sourcedirs.

+
+
+ + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest-members.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest-members.html new file mode 100644 index 000000000..3048f9701 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest-members.html @@ -0,0 +1,18 @@ + + + + + + List of All Members for DocTest | Test + + + +

List of All Members for DocTest

+

This is the complete list of members for DocTest, including inherited members.

+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest.html new file mode 100644 index 000000000..e1475d5fb --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-doctest.html @@ -0,0 +1,86 @@ + + + + + + DocTest QML Type | Test + + + +

DocTest QML Type

+ + +

Represents a doc test case. More...

+ +
+
Import Statement: import QDoc.Test 1.1
Since: QDoc.Test 0.9
+ +

Properties

+ + +

Methods

+ + + +

Detailed Description

+ +

Introduction

+

A documentation test case, itself documented inline in DocTest.qml.

+ +

Property Documentation

+ +
+
+ + +

+active : bool

+

Whether the test is active.

+

See also name.

+
+
+ +
+
+ + +

+name : string

+

Name of the test.

+
DocTest {
+    name: "test"
+    // ...
+}
+
+
+

Method Documentation

+ +
+
+ + +

+fail(message = "oops")

+

Fails the current test case, with the optional message.

+

This method was introduced in QDoc.Test 1.0.

+
+
+ + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type-members.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type-members.html new file mode 100644 index 000000000..91cfa8643 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type-members.html @@ -0,0 +1,31 @@ + + + + + + List of All Members for Type | Test + + + +

List of All Members for Type

+

This is the complete list of members for Type, including inherited members.

+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type.html new file mode 100644 index 000000000..166cbee81 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/qml-qdoc-test-type.html @@ -0,0 +1,185 @@ + + + + + + Type QML Type | Test + + + +

Type QML Type

+ + +

A QML type documented in a .cpp file. More...

+ +
+
Import Statement: import QDoc.Test 1.1
Instantiates: Test
+ +

Properties

+ + +

Attached Properties

+
    +
  • type : enumeration
  • +
+ +

Signals

+ + +

Attached Signals

+ + +

Methods

+ + + +

Detailed Description

+ +

Property Documentation

+ +
+
+
+ + + + +

+fifth : int

+fourth : int

+

A group of properties sharing a documentation comment.

+
+
+ +
+
+ + + + + + + +

group group

+group.first : int

+group.second : int

+group.third : int

+

A property group.

+
+
+ +
+
+ + +

+[read-only] id : int

+

A read-only property.

+
+
+ +
+
+ + +

+name : string

+

Name of the Test.

+
+
+

Attached Property Documentation

+ +
+
+ + +

+Type.type : enumeration

+
+ + +
ConstantDescription
Type.NoTypeNothing
Type.SomeTypeSomething
+
+
+

Signal Documentation

+ +
+
+ + +

+completed(status)

+

This signal is emitted when the operation completed with status.

+
+
+

Attached Signal Documentation

+ +
+
+ + +

+configured()

+

This attached signal is emitted when the type was configured.

+
+
+

Method Documentation

+ +
+
+
+ + + + +

+disable()

+enable()

+

Enables or disables this type.

+
+
+ +
+
+ + +

+Type copy(a)

+

Returns another Type based on a.

+
+
+ + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/test.index b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/test.index new file mode 100644 index 000000000..f45b33114 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/test.index @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testcpp-module.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testcpp-module.html new file mode 100644 index 000000000..b1301b5d0 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testcpp-module.html @@ -0,0 +1,42 @@ + + + + + + QDoc Test C++ Classes | Test + + + +

QDoc Test C++ Classes

+ + +

A test module page. More...

+ + +

Namespaces

+
+ +

TestQDoc

A namespace

+ +

Classes

+
+ + +

TestQDoc::Test

A class in a namespace

TestQDoc::TestDerived

A derived class in a namespace

+ + +
+

Detailed Description

+
+ + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-members.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-members.html new file mode 100644 index 000000000..6f3ca0ff5 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-members.html @@ -0,0 +1,22 @@ + + + + + + List of All Members for Test | Test + + +
  • Test
  • + +

    List of All Members for Test

    +

    This is the complete list of members for TestQDoc::Test, including inherited members.

    + + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-obsolete.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-obsolete.html new file mode 100644 index 000000000..088c2ee99 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test-obsolete.html @@ -0,0 +1,36 @@ + + + + + + Obsolete Members for Test | Test + + +
  • Test
  • + +

    Obsolete Members for Test

    +

    The following members of class Test are obsolete. They are provided to keep old source code working. We strongly advise against using them in new code.

    +

    Public Functions

    +
    + + + +
    (obsolete) void anotherObsoleteMember()
    (obsolete) void deprecatedMember()
    (obsolete) void obsoleteMember()
    +

    Member Function Documentation

    + +

    void Test::anotherObsoleteMember()

    +

    This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

    +

    Use obsoleteMember() instead.

    + + +

    void Test::deprecatedMember()

    +

    This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

    +

    Use someFunction() instead.

    + + +

    void Test::obsoleteMember()

    +

    This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

    +

    Use someFunction() instead.

    + + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test.html new file mode 100644 index 000000000..53db06685 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-test.html @@ -0,0 +1,91 @@ + + + + + + Test Class | Test + + +
  • Test
  • + +

    Test Class

    +(TestQDoc::Test)
    + +

    A class in a namespace. More...

    + +
    +
    Header: #include <Test> +
    qmake: QT += testcpp
    Instantiated By: Type
    Inherited By:

    TestQDoc::TestDerived

    +
    + +

    Public Functions

    +
    + + + + +
    void inlineFunction()
    int someFunction(int v)
    void someFunctionDefaultArg(int i, bool b = false)
    virtual void virtualFun()
    + +

    Protected Functions

    +
    + + +
    void overload()
    void overload(bool b)
    + +

    Macros

    + + + +
    +

    Detailed Description

    +
    + +
    +

    Member Function Documentation

    + +
    +

    [protected] void Test::overload()

    [protected] void Test::overload(bool b)

    +

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

    + + +

    void Test::inlineFunction()

    +

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

    + + +

    int Test::someFunction(int v)

    +

    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.

    + +
    +
    +

    Macro Documentation

    + +

    QDOCTEST_MACRO2(x)

    +

    A macro with argument x.

    +

    This function was introduced in Test 1.1.

    + +
    + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived-members.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived-members.html new file mode 100644 index 000000000..0babbbd5f --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived-members.html @@ -0,0 +1,22 @@ + + + + + + List of All Members for TestDerived | Test + + +
  • TestDerived
  • + +

    List of All Members for TestDerived

    +

    This is the complete list of members for TestQDoc::TestDerived, including inherited members.

    + + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived.html new file mode 100644 index 000000000..8f7517cd3 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc-testderived.html @@ -0,0 +1,48 @@ + + + + + + TestDerived Class | Test + + +
  • TestDerived
  • + +

    TestDerived Class

    +(TestQDoc::TestDerived)
    + +

    A derived class in a namespace. More...

    + +
    +
    Header: #include <TestDerived> +
    qmake: QT += testcpp
    Inherits: TestQDoc::Test
    + +

    Reimplemented Public Functions

    +
    + +
    virtual void virtualFun() override
    + + +
    +

    Detailed Description

    +
    + +
    +

    Member Function Documentation

    + +

    [override virtual] void TestDerived::virtualFun()

    +

    Reimplements: Test::virtualFun().

    + +
    + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc.html new file mode 100644 index 000000000..9c6f5b6ae --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/testqdoc.html @@ -0,0 +1,64 @@ + + + + + + TestQDoc Namespace | Test + + + +

    TestQDoc Namespace

    + +

    A namespace. More...

    + +
    +
    Header: #include <TestCPP> +
    qmake: QT += testcpp
      +
    + +

    Classes

    +
    + + +
    class Test
    class TestDerived
    + +

    Macros

    + + + +
    +

    Detailed Description

    + +

    Usage

    +

    This namespace is for testing QDoc output.

    +
    + +
    +

    Classes

    +

    class Test

    +

    A class in a namespace. More...

    + +

    class TestDerived

    +

    A derived class in a namespace. More...

    + +
    +
    +

    Macro Documentation

    + +

    QDOCTEST_MACRO

    + +
    + + diff --git a/tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/anotherindex.qdoc b/tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/anotherindex.qdoc new file mode 100644 index 000000000..75dd9197d --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/anotherindex.qdoc @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +//! exampledirs-include + \page index.html + \title doc index + + \section1 C++ Classes + \generatelist {classesbymodule TestCPP} + \section1 QML Types + \annotatedlist qmltypes +//! exampledirs-include +*/ diff --git a/tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/parentinclude.qdoc b/tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/parentinclude.qdoc new file mode 100644 index 000000000..c95e22125 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/includefromexampledirs/excludes/parentinclude.qdoc @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +//! abstract-type + \qmltype AbstractParent + \ingroup qmltypes + \qmlabstract + \brief Abstract base QML type. +//! abstract-type +*/ + +/*! +//! children-qmlproperty + \qmlproperty list AbstractParent::children + \default + \brief Children of the type. +//! children-qmlproperty +*/ + +/*! +//! rear-qmlmethod + \qmlmethod void AbstractParent::rear(Child child) + \brief Do some abstract parenting on \a child. +//! rear-qmlmethod +*/ + +/*! + \qmltype Child + \ingroup qmltypes + \inherits AbstractParent + \brief A Child inheriting its parent. +*/ + +/*! + \qmlbasictype int + \ingroup qmltypes + \brief An integer basic type. +*/ diff --git a/tests/auto/qdoc/generatedoutput/includefromexampledirs/includefromexampledirs.qdocconf b/tests/auto/qdoc/generatedoutput/includefromexampledirs/includefromexampledirs.qdocconf new file mode 100644 index 000000000..05683c80b --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/includefromexampledirs/includefromexampledirs.qdocconf @@ -0,0 +1,12 @@ +include(../testqml.qdocconf) + +includepaths += .. +sourcedirs += src + +excludedirs += excludes \ + ../qml/componentset + +exampledirs += excludes + +HTML.nosubdirs = true +HTML.outputsubdir = includefromexampledirs diff --git a/tests/auto/qdoc/generatedoutput/includefromexampledirs/src/includefromparent.qdoc b/tests/auto/qdoc/generatedoutput/includefromexampledirs/src/includefromparent.qdoc new file mode 100644 index 000000000..7b4c00b76 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/includefromexampledirs/src/includefromparent.qdoc @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the tools applications of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! +\include anotherindex.qdoc exampledirs-include + +\include parent.qdocinc +*/ + +/*! +\include parentinclude.qdoc abstract-type + +\include parent.qdocinc +*/ + +/*! +\include parentinclude.qdoc children-qmlproperty + +\include parent.qdocinc +*/ + +/*! +\include parentinclude.qdoc rear-qmlmethod + +\include parent.qdocinc +*/ diff --git a/tests/auto/qdoc/generatedoutput/includefromexampledirs/src/parent.qdocinc b/tests/auto/qdoc/generatedoutput/includefromexampledirs/src/parent.qdocinc new file mode 100644 index 000000000..307c39dbd --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/includefromexampledirs/src/parent.qdocinc @@ -0,0 +1 @@ +Test include file that is part of the sourcedirs. diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index ce4aefa99..3fa2c954f 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -49,6 +49,7 @@ private slots: void examplesManifestXml(); void inheritedQmlPropertyGroups(); + void includeFromExampleDirs(); private: QScopedPointer m_outputDir; @@ -251,6 +252,13 @@ void tst_generatedOutput::inheritedQmlPropertyGroups() "qmlpropertygroups/qml-qdoc-test-anotherchild-members.html"); } +void tst_generatedOutput::includeFromExampleDirs() +{ + testAndCompare("includefromexampledirs/includefromexampledirs.qdocconf", + "includefromexampledirs/index.html " + "includefromexampledirs/qml-qdoc-test-abstractparent.html " + "includefromexampledirs/qml-qdoc-test-abstractparent-members.html"); +} QTEST_APPLESS_MAIN(tst_generatedOutput) #include "tst_generatedoutput.moc" -- cgit v1.2.3