From 5eae325fcb4140155fe97ee0dff6101e4a2db444 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 12 Nov 2019 12:41:24 -0800 Subject: QMake: fix GCC 9 -Wdeprecated-copy warnings Cherry-pick of efa183309e69f317189ef06fb1f13b60da9d7c63. Looks like it was never cherry-picked as intended. Change-Id: Iad959315ad374ef288f5fffd15d684efbcdc6197 Reviewed-by: Ville Voutilainen --- src/linguist/shared/proitems.h | 1 + src/linguist/shared/qmakeparser.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linguist/shared/proitems.h b/src/linguist/shared/proitems.h index c7af53b1c..37a25196a 100644 --- a/src/linguist/shared/proitems.h +++ b/src/linguist/shared/proitems.h @@ -67,6 +67,7 @@ class ProString { public: ProString(); ProString(const ProString &other); + ProString &operator=(const ProString &) = default; PROITEM_EXPLICIT ProString(const QString &str); PROITEM_EXPLICIT ProString(const QStringRef &str); PROITEM_EXPLICIT ProString(const char *str); diff --git a/src/linguist/shared/qmakeparser.h b/src/linguist/shared/qmakeparser.h index ae76d8c46..22da3c69f 100644 --- a/src/linguist/shared/qmakeparser.h +++ b/src/linguist/shared/qmakeparser.h @@ -111,7 +111,6 @@ private: struct BlockScope { BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {} - BlockScope(const BlockScope &other) { *this = other; } ushort *start; // Where this block started; store length here int braceLevel; // Nesting of braces in scope bool special; // Single-line conditionals inside loops, etc. cannot have else branches -- cgit v1.2.3 From cd50765264adac52dc7ace48b0f339c0b13f76fc Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Mon, 27 Jan 2020 23:45:59 +0100 Subject: qdoc: Allow per-example override of install path The 'examplesinstallpath' configuration variable assumes that all examples - once installed - are located under a common root path. Add a parameter 'installpath', recognized by the \meta command, which can be used for setting the install path for specified examples. Improve the test for examples-manifest.xml to cover the \meta command usage. Task-number: QTBUG-81360 Change-Id: Ibb525a48958005fb3a589ef2d9d212091829231f Reviewed-by: Levon Sargsyan Reviewed-by: Paul Wicking --- src/qdoc/doc/qdoc-manual-markupcmds.qdoc | 16 +++++++++++++ src/qdoc/doc/qtgui-qdocconf.qdoc | 8 +++++-- src/qdoc/generator.cpp | 6 +++-- src/qdoc/htmlgenerator.cpp | 18 +++++++++----- .../qdoc/generatedoutput/examples-qhp.qdocconf | 2 ++ .../expected_output/examples-manifest.xml | 6 ++--- .../html/test-componentset-example.webxml | 28 ++++++++++++++++++++-- .../expected_output/test-componentset-example.html | 10 ++++++++ .../generatedoutput/qml/componentset/examples.qdoc | 4 ++++ tests/auto/qdoc/generatedoutput/testqml.qdocconf | 2 ++ 10 files changed, 85 insertions(+), 15 deletions(-) diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 9c11fdd49..51aa3c2cc 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -3888,6 +3888,22 @@ This would result in the following tags: \e {tutorial,basic,hello,world}. Common words such as \e example are ignored. + \b {Example Install Paths} + + The \\meta command combined with an argument \c installpath specifies the + location of an installed example. This value overrides the one that is set + using the \c examplesinstallpath configuration variable. + + \badcode + / *! + \example helloworld + \title Hello World Example + \meta {installpath} {tutorials} + * / + \endcode + + See also \l {examplesinstallpath}. + \target noautolist-command \section1 \\noautolist diff --git a/src/qdoc/doc/qtgui-qdocconf.qdoc b/src/qdoc/doc/qtgui-qdocconf.qdoc index eaed76c67..4161c2917 100644 --- a/src/qdoc/doc/qtgui-qdocconf.qdoc +++ b/src/qdoc/doc/qtgui-qdocconf.qdoc @@ -137,7 +137,7 @@ to content listed in the index. \note QDoc omits this value when the -installdir argument is specified when running QDoc. -\keyword examplesinstallpath +\target examplesinstallpath \badcode examplesinstallpath = gui @@ -150,7 +150,11 @@ installed in the \e gui directory under the parent examples directory \note The examplepath variable has to match the example directory specified in \c exampledirs. -\b {See also}: \l {exampledirs}. +\note It is possible to override the \c exampleinstallpath for a specific + \l {example-command}{\\example} using the \l {meta-command}{\\meta} + command. + +\b {See also}: \l {exampledirs} and \l {meta-command}{\\meta}. \badcode qhp.projects = QtGui diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 846db961a..46d3ad453 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -960,8 +960,10 @@ void Generator::generateLinkToExample(const ExampleNode *en, CodeMarker *marker, } // Construct a path to the example; / - QStringList path = QStringList() - << config()->getString(CONFIG_EXAMPLESINSTALLPATH) << en->name(); + QString pathRoot = en->doc().metaTagMap().value(QLatin1String("installpath")); + if (pathRoot.isEmpty()) + pathRoot = config()->getString(CONFIG_EXAMPLESINSTALLPATH); + QStringList path = QStringList() << pathRoot << en->name(); path.removeAll({}); Text text; diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 9f29d099c..8d6d5000f 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -219,8 +219,6 @@ void HtmlGenerator::initializeGenerator(const Config &config) + QLatin1Char('/'); readManifestMetaContent(config); examplesPath = config.getString(CONFIG_EXAMPLESINSTALLPATH); - if (!examplesPath.isEmpty()) - examplesPath += QLatin1Char('/'); // Retrieve the config for the navigation bar homepage = config.getString(CONFIG_NAVIGATION + Config::dot + CONFIG_HOMEPAGE); @@ -3892,6 +3890,14 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString } else if (en->name().startsWith("demos")) { continue; } + + // Retrieve the install path specified with \meta command, + // or fall back to the one defined in .qdocconf + QString installPath = en->doc().metaTagMap().value(QLatin1String("installpath")); + if (installPath.isEmpty()) + installPath = examplesPath; + if (!installPath.isEmpty() && !installPath.endsWith(QLatin1Char('/'))) + installPath += QLatin1Char('/'); // attributes that are always written for the element usedAttributes.clear(); usedAttributes << "name" @@ -3911,7 +3917,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString } if (!proFiles.isEmpty()) { if (proFiles.size() == 1) { - writer.writeAttribute("projectPath", examplesPath + proFiles[0]); + writer.writeAttribute("projectPath", installPath + proFiles[0]); } else { QString exampleName = en->name().split('/').last(); bool proWithExampleNameFound = false; @@ -3920,13 +3926,13 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString || proFiles[j].endsWith(QStringLiteral("%1/%1.qmlproject").arg(exampleName)) || proFiles[j].endsWith( QStringLiteral("%1/%1.pyproject").arg(exampleName))) { - writer.writeAttribute("projectPath", examplesPath + proFiles[j]); + writer.writeAttribute("projectPath", installPath + proFiles[j]); proWithExampleNameFound = true; break; } } if (!proWithExampleNameFound) - writer.writeAttribute("projectPath", examplesPath + proFiles[0]); + writer.writeAttribute("projectPath", installPath + proFiles[0]); } } if (!en->imageFileName().isEmpty()) { @@ -4064,7 +4070,7 @@ void HtmlGenerator::generateManifestFile(const QString &manifest, const QString if (--it == filesToOpen.constBegin()) { writer.writeAttribute(QStringLiteral("mainFile"), QStringLiteral("true")); } - writer.writeCharacters(examplesPath + it.value()); + writer.writeCharacters(installPath + it.value()); writer.writeEndElement(); } diff --git a/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf b/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf index 816d1d1a4..b4598476e 100644 --- a/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf +++ b/tests/auto/qdoc/generatedoutput/examples-qhp.qdocconf @@ -1,6 +1,8 @@ # QML test includes a documented example include(testqml.qdocconf) +examplesinstallpath = test + # Configure .qhp generation qhp.projects = Test diff --git a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml index 330923033..7f206d0e8 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/examples-manifest.xml @@ -1,9 +1,9 @@ - - - documentation,qml,test + + + documentation,qml,sample,test diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml index 8689d2e76..29ed944ba 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml @@ -1,12 +1,13 @@ - + - + + Example for documenting QML types. This example demonstrates one of the ways to document QML types. In particular, there are sample types that are documented with QDoc commands comments. There are documentation comments for the QML types and their public interfaces. The types are grouped into a module, the UI Components module. The uicomponents.qdoc file generates the overview page for the UI Components module page. @@ -32,6 +33,29 @@ An aliased property of type int. QML Types with C++ Implementation This example only demonstrates the documentation for types in QML files, but the regular QML commands may be placed inside C++ classes to define the public API of the QML type. + Files: + + + + componentset/ProgressBar.qml + + + + + componentset/Switch.qml + + + + + componentset/TabWidget.qml + + + + + componentset/componentset.pro + + + diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test-componentset-example.html b/tests/auto/qdoc/generatedoutput/expected_output/test-componentset-example.html index faf632bea..8b792090f 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/test-componentset-example.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/test-componentset-example.html @@ -19,6 +19,9 @@

QML Documentation Example

+ +

Example for documenting QML types.

+

This example demonstrates one of the ways to document QML types.

@@ -42,6 +45,13 @@ An aliased property of type int

QML Types with C++ Implementation

This example only demonstrates the documentation for types in QML files, but the regular QML commands may be placed inside C++ classes to define the public API of the QML type.

+

Files:

+
diff --git a/tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc b/tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc index 7c780eca8..2f56c221c 100644 --- a/tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc +++ b/tests/auto/qdoc/generatedoutput/qml/componentset/examples.qdoc @@ -28,6 +28,10 @@ /*! \example componentset \title QML Documentation Example + \brief Example for documenting QML types. + + \meta tag {test,sample} + \meta installpath tutorials This example demonstrates one of the ways to document QML types. diff --git a/tests/auto/qdoc/generatedoutput/testqml.qdocconf b/tests/auto/qdoc/generatedoutput/testqml.qdocconf index c469bde06..f618fe1b8 100644 --- a/tests/auto/qdoc/generatedoutput/testqml.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testqml.qdocconf @@ -16,5 +16,7 @@ excludedirs = ./bug80259 sources.fileextensions = "*.qml *.cpp *.qdoc" headers.fileextensions = "*.h" +examples.fileextensions = "*.qml" + macro.begincomment = "\\c{/*}" macro.QDocTestVer = "1.1" -- cgit v1.2.3 From 653884ab6988ea72fc0d5cc21675efcef67d0455 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 29 Jan 2020 13:14:32 +0100 Subject: qdoc: Override isObsolete() for a FunctionNode Make Node::isObsolete() virtual and override it for FunctionNode. This is needed to treat access functions of obsolete properties also as obsolete. Remove FunctionNode::hasActiveAssociatedProperty() as it was a workaround for isObsolete() not being complete for function nodes. Fixes: QTBUG-79386 Change-Id: If7597ca19f35b4582979bed36f628874c5beac07 Reviewed-by: Paul Wicking --- src/qdoc/node.cpp | 28 ++++++++++++++++------------ src/qdoc/node.h | 4 ++-- src/qdoc/sections.cpp | 4 +--- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 65c75e743..5415f14cd 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -4204,19 +4204,23 @@ void FunctionNode::addAssociatedProperty(PropertyNode *p) } /*! - Returns true if this function has at least one property - that is active, i.e. at least one property that is not - obsolete. - */ -bool FunctionNode::hasActiveAssociatedProperty() const + \reimp + + Returns \c true if this is an access function for an obsolete property, + otherwise calls the base implementation of isObsolete(). +*/ +bool FunctionNode::isObsolete() const { - if (associatedProperties_.isEmpty()) - return false; - for (const auto *property : qAsConst(associatedProperties_)) { - if (!property->isObsolete()) - return true; - } - return false; + auto it = std::find_if_not(associatedProperties_.begin(), + associatedProperties_.end(), + [](const Node *p)->bool { + return p->isObsolete(); + }); + + if (!associatedProperties_.isEmpty() && it == associatedProperties_.end()) + return true; + + return Node::isObsolete(); } /*! \fn unsigned char FunctionNode::overloadNumber() const diff --git a/src/qdoc/node.h b/src/qdoc/node.h index 739c262b4..345a20033 100644 --- a/src/qdoc/node.h +++ b/src/qdoc/node.h @@ -183,7 +183,6 @@ public: bool isJsType() const { return nodeType_ == JsType; } bool isModule() const { return nodeType_ == Module; } bool isNamespace() const { return nodeType_ == Namespace; } - bool isObsolete() const { return (status_ == Obsolete); } bool isPage() const { return nodeType_ == Page; } bool isPreliminary() const { return (status_ == Preliminary); } bool isPrivate() const { return access_ == Private; } @@ -205,6 +204,7 @@ public: bool isVariable() const { return nodeType_ == Variable; } bool isGenericCollection() const { return (nodeType_ == Node::Collection); } + virtual bool isObsolete() const { return (status_ == Obsolete); } virtual bool isAbstract() const { return false; } virtual bool isAggregate() const { return false; } // means "can have children" virtual bool isFirstClassAggregate() const @@ -1025,6 +1025,7 @@ public: bool isMacroWithParams() const { return (metaness_ == MacroWithParams); } bool isMacroWithoutParams() const { return (metaness_ == MacroWithoutParams); } bool isMacro() const override { return (isMacroWithParams() || isMacroWithoutParams()); } + bool isObsolete() const override; bool isCppFunction() const { return metaness_ == Plain; } // Is this correct? bool isSignal() const { return (metaness_ == Signal); } @@ -1065,7 +1066,6 @@ public: bool hasAssociatedProperties() const { return !associatedProperties_.isEmpty(); } bool hasOneAssociatedProperty() const { return (associatedProperties_.size() == 1); } Node *firstAssociatedProperty() const { return associatedProperties_[0]; } - bool hasActiveAssociatedProperty() const; QString element() const override { return parent()->name(); } bool isAttached() const override { return attached_; } diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp index 64bef16b4..6cad782de 100644 --- a/src/qdoc/sections.cpp +++ b/src/qdoc/sections.cpp @@ -728,9 +728,7 @@ void Sections::distributeNodeInSummaryVector(SectionVector &sv, Node *n) sv[RelatedNonmembers].insert(n); return; } - if (fn->hasAssociatedProperties() && !fn->hasActiveAssociatedProperty()) - return; - else if (fn->isIgnored()) + if (fn->isIgnored()) return; if (fn->isSlot()) { if (fn->isPublic()) -- cgit v1.2.3 From 01dbe9a348f09cfefc927d1de96d82afbd09f995 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 28 Jan 2020 13:27:19 +0100 Subject: qdoc: Do not sort nodes based on their address QDoc generated different output for two consecutive runs because we were sorting nodes based on the addresses of node pointers. Use the existing comparison function for sorting nodes. This makes QDoc's output deterministic. Fixes: QTBUG-81712 Change-Id: I5e80c82d7582d76c4a3ac1e656f8480159d35240 Reviewed-by: Paul Wicking Reviewed-by: Levon Sargsyan --- src/qdoc/node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 5415f14cd..3e43c5644 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -2213,7 +2213,7 @@ void Aggregate::normalizeOverloads() const NodeList &Aggregate::nonfunctionList() { nonfunctionList_ = nonfunctionMap_.values(); - std::sort(nonfunctionList_.begin(), nonfunctionList_.end()); + std::sort(nonfunctionList_.begin(), nonfunctionList_.end(), Node::nodeNameLessThan); nonfunctionList_.erase(std::unique(nonfunctionList_.begin(), nonfunctionList_.end()), nonfunctionList_.end()); return nonfunctionList_; -- cgit v1.2.3 From 1639c9a80490fc56c2bb1438dfa0d84455be55ed Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Fri, 9 Aug 2019 13:46:08 +0200 Subject: QDoc: Move logging to helper method Change-Id: I39d10454442178e6f1292d136eea8ee990ad162f Reviewed-by: Edward Welbourne --- src/qdoc/main.cpp | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index 2b2b7a6f8..79cb471ce 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -223,6 +223,27 @@ static void loadIndexFiles(Config &config, const QSet &formats) qdb->readIndexes(indexFiles); } +/*! + \internal + Prints to stderr the name of the project that QDoc is running for, + in which mode and which phase. + + If QDoc is running in debug mode, also logs the command line arguments. + */ +void logStartEndMessage(const QLatin1String &startStop, const Config &config) +{ + const QString runName = " qdoc for " + + config.getString(CONFIG_PROJECT) + + QLatin1String(" in ") + + QLatin1String(Generator::singleExec() ? "single" : "dual") + + QLatin1String(" process mode, (") + + QLatin1String(Generator::preparing() ? "prepare" : "generate") + + QLatin1String(" phase)"); + + const QString msg = startStop + runName; + Location::logToStdErrAlways(msg); +} + /*! Processes the qdoc config file \a fileName. This is the controller for all of QDoc. The \a config instance represents the configuration data for QDoc. @@ -255,22 +276,13 @@ static void processQdocconfFile(const QString &fileName, Config &config) if (!config.currentDir().isEmpty()) QDir::setCurrent(config.currentDir()); - QString phase = " in "; - if (Generator::singleExec()) - phase += "single process mode, "; - else - phase += "dual process mode, "; - if (Generator::preparing()) - phase += "(prepare phase)"; - else if (Generator::generating()) - phase += "(generate phase)"; + logStartEndMessage(QLatin1String("Start"), config); - QString msg = "Start qdoc for " + config.getString(CONFIG_PROJECT) + phase; - Location::logToStdErrAlways(msg); if (config.getDebug()) { Utilities::startDebugging(QString("command line")); qCDebug(lcQdoc).noquote() << "Arguments:" << QCoreApplication::arguments(); } + /* Initialize all the classes and data structures with the qdoc configuration. This is safe to do for each qdocconf @@ -505,8 +517,7 @@ static void processQdocconfFile(const QString &fileName, Config &config) if (Utilities::debugging()) Utilities::stopDebugging(project); - msg = "End qdoc for " + config.getString(CONFIG_PROJECT) + phase; - Location::logToStdErrAlways(msg); + logStartEndMessage(QLatin1String("End"), config); QDocDatabase::qdocDB()->setVersion(QString()); Generator::terminate(); CodeParser::terminate(); -- cgit v1.2.3 From a3d82bec9678fda3d8c8b7766e83267142d1ef4a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sun, 2 Feb 2020 13:41:46 +0100 Subject: Bump version Change-Id: I9c139ec10969ed15ab3eed71be0943b7250dc791 --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index c3ff36444..858804d53 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST -MODULE_VERSION = 5.14.1 +MODULE_VERSION = 5.14.2 -- cgit v1.2.3 From cd352d921fc2f523f8d83d387d51390305e71d89 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Wed, 5 Feb 2020 07:46:37 +0100 Subject: Doc: Remove references to 4.x in QDoc manual Fixes: QTBUG-48218 Change-Id: Iedbb20225d41cfd3213b8b7a1737da41b4e64561 Reviewed-by: Venugopal Shivashankar --- src/qdoc/doc/qdoc-manual-contextcmds.qdoc | 10 +++++----- src/qdoc/doc/qdoc-manual-qdocconf.qdoc | 8 ++++---- src/qdoc/doc/qdoc-manual-topiccmds.qdoc | 24 ++++++++---------------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/qdoc/doc/qdoc-manual-contextcmds.qdoc index 2c42493e8..d3cf23b76 100644 --- a/src/qdoc/doc/qdoc-manual-contextcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-contextcmds.qdoc @@ -672,11 +672,11 @@ \endcode QDoc includes this line on the reference page for the - \l{http://qt-project.org/doc/qt-4.7/qml-pauseanimation.html} {PauseAnimation} + \l [QML] PauseAnimation element: \quotation - Inherits \l{http://qt-project.org/doc/qt-4.7/qml-animation.html} {Animation} + Inherits \l [QML] Animation \endquotation \target overload-command @@ -693,9 +693,9 @@ should be fully documented. Each overload can have whatever extra documentation you want to add for just that overloaded version. - From Qt 4.5, you can include the function name plus '()' as a - parameter to the \b{\\overload} command, which will include a - standard \e{This function overloads...} line of text with a link + You can include the function name plus '()' as a parameter to + the \b{\\overload} command, which will include a standard + \e{This function overloads...} line of text with a link to the documentation for the primary version of the function. \code diff --git a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc index 91f08cbd3..415702e98 100644 --- a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -1221,7 +1221,7 @@ QT_VERSION_STR is defined in qglobal.h as follows \badcode - #define QT_VERSION_STR "4.0.1" + #define QT_VERSION_STR "5.14.1" \endcode When a version number is specified (using the \tt{\l version} or @@ -1726,14 +1726,14 @@ \badcode project = Qt description = Qt Reference Documentation - url = http://doc.qt.io/qt-4.8/ + url = https://doc.qt.io/qt/ ... \endcode This makes sure that whenever \c qt.index is used to generate references to for example Qt classes, the base URL is \c - http://doc.qt.io/qt-4.8/. + https://doc.qt.io/qt/. See also \l indexes and \l {url.examples}. @@ -1801,7 +1801,7 @@ \badcode project = Qt description = Qt Reference Documentation - url = http://doc.qt.io/qt-4.8/ + url = http://doc.qt.io/qt/ ... \endcode diff --git a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc index 5c3de3a98..cdd0c9aeb 100644 --- a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc @@ -812,20 +812,12 @@ - - - - @@ -884,7 +876,7 @@ \quotation \raw HTML -

Qt Namespace Reference

+

Qt Namespace

The Qt namespace contains miscellaneous identifiers used throughout the Qt library. More... @@ -893,15 +885,15 @@

#include <Qt>

Types


\endraw @@ -1206,7 +1198,7 @@ \endcode This example generates the - \l {http://qt-project.org/doc/qt-4.7/qml-transform.html} {QML Transform} + \l {https://doc.qt.io/qt-5/qml-qtquick-transform.html} {QML Transform} page. The \\qmlclass comment should include the \l {since-command} {\\since} command, because all QML types are new. It should also include the \l{brief-command} {\\brief} @@ -1279,7 +1271,7 @@ \endcode The example generates the \l - {http://qt-project.org/doc/qt-4.7/qml-transform.html} {QML Transform} + {https://doc.qt.io/qt-5/qml-qtquick-transform.html} {QML Transform} page. The \e{\\qmltype} comment includes \l{instantiates-command} {\\instantiates} to specify that a Transform is instantiated by the C++ class QGraphicsTransform. A \\qmltype comment should @@ -1412,7 +1404,7 @@ \endcode The example generates the \l - {http://qt-project.org/doc/qt-4.7/qml-transform.html} {QML Transform} + {https://doc.qt.io/qt-5/qml-qtquick-transform.html} {QML Transform} page. The \e{\\qmltype} comment includes \l{instantiates-command} {\\instantiates} to specify that a Transform is instantiated by the C++ class QGraphicsTransform. A \\qmltype comment should -- cgit v1.2.3 From 559332dc3efa507baaaba4ea8288bdb2318bc73d Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 11 Feb 2020 11:23:18 +0100 Subject: qdoc: Fix regression in linking to QML properties in offline docs The elements used for anchors are obsolete, but it turns out the QTextBrowser backend for offline documentation still relies on them. Re-introduce them into the output. This commit partially reverts 5aa19d92. Fixes: QTBUG-82034 Change-Id: Ia4af9c2ed809b12c5f79d27db4dd3eb5e9523d13 Reviewed-by: Paul Wicking --- src/qdoc/htmlgenerator.cpp | 6 +++-- .../qml-qdoc-test-abstractparent.html | 4 ++-- .../expected_output/qml-qdoc-test-child.html | 4 ++-- .../expected_output/qml-qdoc-test-doctest.html | 6 ++--- .../expected_output/qml-qdoc-test-type.html | 28 +++++++++++----------- .../qml-uicomponents-progressbar.html | 10 ++++---- .../expected_output/qml-uicomponents-switch.html | 4 ++-- .../qml-uicomponents-tabwidget.html | 4 ++-- 8 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 8d6d5000f..fdfb4a65b 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -3625,7 +3625,7 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, const Aggregate *relat "
- QAbstractSocket + QAbstractSocket The base functionality common to all socket types
- QFtp - - Implementation of the FTP protocol -
... ...
\n"); QString qmlItemStart("\n" - "\n"); QString qmlItemFooter("

\n"); + "

\n"); QString qmlItemEnd("

\n"); @@ -3656,8 +3656,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, const Aggregate *relat const SharedCommentNode *scn = static_cast(node); out() << qmlItemHeader; if (!scn->name().isEmpty()) { - out() << ""; + const QString nodeRef = refForNode(scn); + out() << ""; out() << "

"; + out() << ""; out() << "" << scn->name() << " group"; out() << "

\n"; } diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html index 949dc7868..3668112ee 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-abstractparent.html @@ -46,7 +46,7 @@
+[default] children : list<Child>

-[default] children : list<Child>

Children of the type.

@@ -57,7 +57,7 @@
+voidrear(child)

-void rear(child)

Do some abstract parenting on child.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html index 5ba40c99c..22f38cc9c 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-child.html @@ -46,7 +46,7 @@
+[default] children : list<Child>

-[default] children : list<Child>

Children of the type.

@@ -57,7 +57,7 @@
+voidrear(child)

-void rear(child)

Do some abstract parenting on child.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html index a88d935be..e1475d5fb 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-doctest.html @@ -50,7 +50,7 @@
+active : bool

-active : bool

Whether the test is active.

See also name.

@@ -61,7 +61,7 @@
+name : string

-name : string

Name of the test.

DocTest {
@@ -76,7 +76,7 @@
 
+fail(message = "oops")

-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/qml-qdoc-test-type.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html index 363a4bf16..166cbee81 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-qdoc-test-type.html @@ -75,10 +75,10 @@
+fifth : int

+fourth : int

-fifth : int

-fourth : int

A group of properties sharing a documentation comment.

@@ -86,16 +86,16 @@
- + +group.first : int

+group.second : int

+group.third : int

group group

group group

-group.first : int

-group.second : int

-group.third : int

A property group.

@@ -105,7 +105,7 @@
+[read-only] id : int

-[read-only] id : int

A read-only property.

@@ -115,7 +115,7 @@
+name : string

-name : string

Name of the Test.

@@ -126,7 +126,7 @@
+Type.type : enumeration

-Type.type : enumeration

@@ -140,7 +140,7 @@
ConstantDescription
Type.NoTypeNothing
+completed(status)

-completed(status)

This signal is emitted when the operation completed with status.

@@ -151,7 +151,7 @@
+configured()

-configured()

This attached signal is emitted when the type was configured.

@@ -163,10 +163,10 @@
+disable()

+enable()

-disable()

-enable()

Enables or disables this type.

@@ -176,7 +176,7 @@
+Typecopy(a)

-Type copy(a)

Returns another Type based on a.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html index 6cfe36a83..a1b43ea9d 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-progressbar.html @@ -46,7 +46,7 @@
+color : color

-color : color

The color of the ProgressBar's gradient. Must bind to a color type.

See also secondColor.

@@ -57,7 +57,7 @@
+maximum : int

-maximum : int

The maximum value of the ProgressBar range. The value must not be more than this value.

@@ -67,7 +67,7 @@
+minimum : int

-minimum : int

The minimum value of the ProgressBar range. The value must not be less than this value.

@@ -77,7 +77,7 @@
+secondColor : color

-secondColor : color

The second color of the ProgressBar's gradient. Must bind to a color type.

See also color.

@@ -88,7 +88,7 @@
+value : int

-value : int

The value of the progress.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html index 5ebae4905..fadb1a531 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-switch.html @@ -48,7 +48,7 @@
+on : bool

-on : bool

Indicates the state of the switch. If false, then the switch is in the off state.

@@ -59,7 +59,7 @@
+toggle()

-toggle()

A method to toggle the switch. If the switch is on, the toggling it will turn it off. Toggling a switch in the off position will turn it on.

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html index 2c48e1ddd..1b2421722 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/qml-uicomponents-tabwidget.html @@ -62,7 +62,7 @@
+current : int

-current : int

The currently active tab in the TabWidget.

@@ -72,7 +72,7 @@
+[read-only] sampleReadOnlyProperty : int

-[read-only] sampleReadOnlyProperty : int

A sample read-only property. A contrived property to demonstrate QDoc's ability to detect read-only properties.

The signature is:

-- cgit v1.2.3 From 26daab2554a55243a0cb6744346e1cfb27cfc3a9 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Thu, 26 Sep 2019 16:23:15 +0200 Subject: QDoc: Remove Location::null MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As Location is not a CoW class, the use of Location::null over Location() seems unfounded. Remove the static null object and replace its use. Change-Id: I27dd4dfabffbfedb4f310dac43614e1ebb03c522 Reviewed-by: Topi Reiniƶ --- src/qdoc/config.cpp | 8 ++++---- src/qdoc/doc.cpp | 2 +- src/qdoc/location.cpp | 14 ++++++-------- src/qdoc/location.h | 2 -- src/qdoc/main.cpp | 10 +++++----- src/qdoc/qdocdatabase.cpp | 8 ++++---- src/qdoc/qdoctagfiles.cpp | 2 +- src/qdoc/quoter.cpp | 2 +- 8 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp index e7ca42150..55a23610b 100644 --- a/src/qdoc/config.cpp +++ b/src/qdoc/config.cpp @@ -275,7 +275,7 @@ Config::~Config() */ void Config::clear() { - loc = lastLocation_ = Location::null; + loc = lastLocation_ = Location(); configVars_.clear(); includeFilesMap_.clear(); } @@ -327,12 +327,12 @@ void Config::load(const QString &fileName) if (configVars_.contains(CONFIG_PROJECT)) reset(); - load(Location::null, fileName); + load(Location(), fileName); if (loc.isEmpty()) loc = Location(fileName); else loc.setEtc(true); - lastLocation_ = Location::null; + lastLocation_ = Location(); // Add defines and includepaths from command line to their // respective configuration variables. Values set here are @@ -965,7 +965,7 @@ bool Config::isMetaKeyChar(QChar ch) */ QStringList Config::loadMaster(const QString &fileName) { - Location location = Location::null; + Location location; QFile fin(fileName); if (!fin.open(QFile::ReadOnly | QFile::Text)) { if (!Config::installDir.isEmpty()) { diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp index 89748b0ad..e20870319 100644 --- a/src/qdoc/doc.cpp +++ b/src/qdoc/doc.cpp @@ -328,7 +328,7 @@ typedef QMap CommandMap; class DocPrivate : public Shared { public: - DocPrivate(const Location &start = Location::null, const Location &end = Location::null, + DocPrivate(const Location &start = Location(), const Location &end = Location(), const QString &source = QString()); ~DocPrivate(); diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp index aab8ede19..dc378b1d1 100644 --- a/src/qdoc/location.cpp +++ b/src/qdoc/location.cpp @@ -42,8 +42,6 @@ QT_BEGIN_NAMESPACE -const Location Location::null; - int Location::tabSize; int Location::warningCount = 0; int Location::warningLimit = -1; @@ -283,7 +281,7 @@ int Location::exitCode() if (warningLimit < 0 || warningCount <= warningLimit) return EXIT_SUCCESS; - Location::null.emitMessage( + Location().emitMessage( Error, tr("Documentation warnings (%1) exceeded the limit (%2) for '%3'.") .arg(QString::number(warningCount), QString::number(warningLimit), project), @@ -391,11 +389,11 @@ void Location::logToStdErrAlways(const QString &message) */ void Location::internalError(const QString &hint) { - Location::null.fatal(tr("Internal error (%1)").arg(hint), - tr("There is a bug in %1. Seek advice from your local" - " %2 guru.") - .arg(programName) - .arg(programName)); + Location().fatal(tr("Internal error (%1)").arg(hint), + tr("There is a bug in %1. Seek advice from your local" + " %2 guru.") + .arg(programName) + .arg(programName)); } /*! diff --git a/src/qdoc/location.h b/src/qdoc/location.h index 9ad601e1b..fb35038a8 100644 --- a/src/qdoc/location.h +++ b/src/qdoc/location.h @@ -80,8 +80,6 @@ public: void fatal(const QString &message, const QString &details = QString()) const; void report(const QString &message, const QString &details = QString()) const; - static const Location null; - static void initialize(const Config &config); static void terminate(); static void information(const QString &message); diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index 79cb471ce..72259d4e3 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -97,7 +97,7 @@ static void loadIndexFiles(Config &config, const QSet &formats) if (fi.exists() && fi.isFile()) indexFiles << index; else - Location::null.warning(QString("Index file not found: %1").arg(index)); + Location().warning(QString("Index file not found: %1").arg(index)); } config.dependModules() += config.getStringList(CONFIG_DEPENDS); @@ -194,10 +194,10 @@ static void loadIndexFiles(Config &config, const QSet &formats) indexPaths.reserve(foundIndices.size()); for (const auto &found : qAsConst(foundIndices)) indexPaths << found.absoluteFilePath(); - Location::null.warning( + Location().warning( QString("Multiple index files found for dependency \"%1\":\n%2") .arg(module, indexPaths.join('\n'))); - Location::null.warning( + Location().warning( QString("Using %1 as index file for dependency \"%2\"") .arg(foundIndices[foundIndices.size() - 1].absoluteFilePath(), module)); @@ -209,13 +209,13 @@ static void loadIndexFiles(Config &config, const QSet &formats) if (!indexFiles.contains(indexToAdd)) indexFiles << indexToAdd; } else if (!asteriskUsed) { - Location::null.warning( + Location().warning( QString("\"%1\" Cannot locate index file for dependency \"%2\"") .arg(config.getString(CONFIG_PROJECT), module)); } } } else { - Location::null.warning( + Location().warning( QLatin1String("Dependent modules specified, but no index directories were set. " "There will probably be errors for missing links.")); } diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp index be257b4b8..f32c4b7dc 100644 --- a/src/qdoc/qdocdatabase.cpp +++ b/src/qdoc/qdocdatabase.cpp @@ -336,7 +336,7 @@ const Node *QDocForest::findNodeForTarget(QStringList &targetPath, const Node *r */ void QDocForest::printLinkCounts(const QString &project) { - Location::null.report(QString("%1: Link Counts").arg(project)); + Location().report(QString("%1: Link Counts").arg(project)); QMultiMap m; for (const auto *tree : searchOrder()) { if (tree->linkCount() < 0) @@ -352,10 +352,10 @@ void QDocForest::printLinkCounts(const QString &project) for (int k = 0; k < pad; ++k) line += QLatin1Char(' '); line += "%1"; - Location::null.report(line.arg(-(it.key()))); + Location().report(line.arg(-(it.key()))); } - Location::null.report("Optimal depends variable:"); - Location::null.report(depends); + Location().report("Optimal depends variable:"); + Location().report(depends); } /*! diff --git a/src/qdoc/qdoctagfiles.cpp b/src/qdoc/qdoctagfiles.cpp index 8d97ce48a..cf593aa4c 100644 --- a/src/qdoc/qdoctagfiles.cpp +++ b/src/qdoc/qdoctagfiles.cpp @@ -341,7 +341,7 @@ void QDocTagFiles::generateTagFile(const QString &fileName, Generator *g) file.setFileName(gen_->outputDir() + QLatin1Char('/') + fileInfo.fileName()); if (!file.open(QFile::WriteOnly | QFile::Text)) { - Location::null.warning(QString("Failed to open %1 for writing.").arg(file.fileName())); + Location().warning(QString("Failed to open %1 for writing.").arg(file.fileName())); return; } diff --git a/src/qdoc/quoter.cpp b/src/qdoc/quoter.cpp index a313ab5c5..fcdc6dee1 100644 --- a/src/qdoc/quoter.cpp +++ b/src/qdoc/quoter.cpp @@ -134,7 +134,7 @@ void Quoter::reset() silent = false; plainLines.clear(); markedLines.clear(); - codeLocation = Location::null; + codeLocation = Location(); } void Quoter::quoteFromFile(const QString &userFriendlyFilePath, const QString &plainCode, -- cgit v1.2.3 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