From a65303b133e47b98c5a3d561def6597aebba56df Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Thu, 26 Sep 2019 14:25:10 +0200 Subject: QDoc: Add basic unit test for Config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Starting point for unit testing Config. Fixes: QTBUG-82672 Change-Id: If9e6300d3388173a08545609aca74c8e6a588041 Reviewed-by: Mårten Nordheim --- tests/auto/qdoc/config/config.pro | 16 +++++++ tests/auto/qdoc/config/tst_config.cpp | 85 +++++++++++++++++++++++++++++++++++ tests/auto/qdoc/qdoc.pro | 1 + 3 files changed, 102 insertions(+) create mode 100644 tests/auto/qdoc/config/config.pro create mode 100644 tests/auto/qdoc/config/tst_config.cpp diff --git a/tests/auto/qdoc/config/config.pro b/tests/auto/qdoc/config/config.pro new file mode 100644 index 000000000..b6cb9a32d --- /dev/null +++ b/tests/auto/qdoc/config/config.pro @@ -0,0 +1,16 @@ +CONFIG += testcase +QT = core testlib +TARGET = tst_config +INCLUDEPATH += $$PWD/../../../../src/qdoc + +HEADERS += \ + $$PWD/../../../../src/qdoc/config.h \ + $$PWD/../../../../src/qdoc/location.h \ + $$PWD/../../../../src/qdoc/qdoccommandlineparser.h \ + $$PWD/../../../../src/qdoc/loggingcategory.h + +SOURCES += \ + tst_config.cpp \ + $$PWD/../../../../src/qdoc/config.cpp \ + $$PWD/../../../../src/qdoc/location.cpp \ + $$PWD/../../../../src/qdoc/qdoccommandlineparser.cpp diff --git a/tests/auto/qdoc/config/tst_config.cpp b/tests/auto/qdoc/config/tst_config.cpp new file mode 100644 index 000000000..1e9383fb9 --- /dev/null +++ b/tests/auto/qdoc/config/tst_config.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** 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 "config.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcQdoc, "qt.test") +QT_END_NAMESPACE + +class tst_Config : public QObject +{ + Q_OBJECT + +private slots: + void classMembersInitializeToFalseOrEmpty(); + void includePathsFromCommandLine(); +}; + +void tst_Config::classMembersInitializeToFalseOrEmpty() +{ + QStringList commandLineArgs = { QStringLiteral("./qdoc") }; + + Config::instance().init("QDoc Test", commandLineArgs); + auto &config = Config::instance(); + QCOMPARE(config.singleExec(), false); + + QVERIFY(config.defines().isEmpty()); + QVERIFY(config.includePaths().isEmpty()); + QVERIFY(config.dependModules().isEmpty()); + QVERIFY(config.indexDirs().isEmpty()); + QVERIFY(config.currentDir().isEmpty()); + QVERIFY(config.previousCurrentDir().isEmpty()); +} + +void tst_Config::includePathsFromCommandLine() +{ + const auto mockIncludePath1 = QString("-I" + QDir().absoluteFilePath("/qt5/qtdoc/doc/.")); + const auto mockIncludePath2 = QString("-I" + QDir().absoluteFilePath("/qt5/qtbase/mkspecs/linux-g++")); + const QStringList commandLineArgs = { + QStringLiteral("./qdoc"), + mockIncludePath1, + mockIncludePath2 + }; + + Config::instance().init("QDoc Test", commandLineArgs); + auto &config = Config::instance(); + + const QStringList expected = { mockIncludePath1, mockIncludePath2 }; + const QStringList actual = config.includePaths(); + + QCOMPARE(actual, expected); +} + +QTEST_APPLESS_MAIN(tst_Config) + +#include "tst_config.moc" diff --git a/tests/auto/qdoc/qdoc.pro b/tests/auto/qdoc/qdoc.pro index 97117dc6f..d2afba2bf 100644 --- a/tests/auto/qdoc/qdoc.pro +++ b/tests/auto/qdoc/qdoc.pro @@ -1,4 +1,5 @@ TEMPLATE = subdirs SUBDIRS = \ + config \ generatedoutput -- cgit v1.2.3 From 60be58eb314349862e09d3fc106bfa23feda170f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 5 Mar 2020 13:48:14 +0100 Subject: Qt Designer: Fix warnings about deprecated style metrics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use PM_LayoutLeftMargin, PM_LayoutHorizontalSpacing instead of PM_DefaultChildMargin, PM_DefaultLayoutSpacing, fixing: formeditor/formwindowsettings.cpp:11452: warning: ‘PM_DefaultChildMargin’ is deprecated [-Wdeprecated-declarations] formeditor/formwindowsettings.cpp:116:53: warning: ‘PM_DefaultLayoutSpacing’ is deprecated [-Wdeprecated-declarations] A child widget needs to be passed to PM_LayoutLeftMargin to correctly obtain the child margin. Change-Id: Ided8fb45d2372a56bae3a0304c35339fcc3b83ee Reviewed-by: Volker Hilsheimer --- src/designer/src/components/formeditor/formwindowsettings.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp index de03c6792..3e24b7623 100644 --- a/src/designer/src/components/formeditor/formwindowsettings.cpp +++ b/src/designer/src/components/formeditor/formwindowsettings.cpp @@ -108,12 +108,13 @@ void FormWindowData::fromFormWindow(FormWindowBase* fw) defaultMargin = defaultSpacing = INT_MIN; fw->layoutDefault(&defaultMargin, &defaultSpacing); - QStyle *style = fw->formContainer()->style(); + auto container = fw->formContainer(); + QStyle *style = container->style(); layoutDefaultEnabled = defaultMargin != INT_MIN || defaultSpacing != INT_MIN; if (defaultMargin == INT_MIN) - defaultMargin = style->pixelMetric(QStyle::PM_DefaultChildMargin, nullptr); + defaultMargin = style->pixelMetric(QStyle::PM_LayoutLeftMargin, nullptr, container); if (defaultSpacing == INT_MIN) - defaultSpacing = style->pixelMetric(QStyle::PM_DefaultLayoutSpacing, nullptr); + defaultSpacing = style->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, nullptr); marginFunction.clear(); -- cgit v1.2.3 From dc8598ab1e441d9b49a3aac1e3812bf93f8a3211 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 4 Mar 2020 17:31:17 +0100 Subject: qdoc: Fix issues in HelpProjectWriter The code that generates Qt Help Project (.qhp) xml files was suffering from multiple issues - mostly related to changes in Node inheritance that were not reflected in HelpProjectWriter implementation. - We no longer have subtypes for page nodes. Therefore, selectors like 'doc:example' were broken. Simplify the selector code but continue supporting the old notation. - Examples and basic QML/JS types were incorrectly dropped from the TOC. - Node::Union and Node::Struct were called 'Class' in the .qhp. Use the Generator::typeString() to fetch the correct type name for all types. - Require .qhp subprojects to have at least a title to avoid empty subsections in the TOC. Add a test that covers the entire .qhp generation with different types of subprojects defined. Fixes: QTBUG-82671 Fixes: QTBUG-82674 Change-Id: I8fe4a8ad5fc6d58f86e0e9128e98c0b8c4ba4a6a Reviewed-by: Qt CI Bot Reviewed-by: Paul Wicking --- src/qdoc/generator.cpp | 2 +- src/qdoc/generator.h | 2 +- src/qdoc/helpprojectwriter.cpp | 127 +++++++------------ src/qdoc/helpprojectwriter.h | 4 +- .../qdoc/generatedoutput/expected_output/test.qhp | 137 +++++++++++++++++++++ .../testdata/configs/examples-qhp.qdocconf | 17 +++ .../qdoc/generatedoutput/tst_generatedoutput.cpp | 8 +- 7 files changed, 209 insertions(+), 88 deletions(-) create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/test.qhp diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 7bb32f471..3e689c4b5 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -2133,8 +2133,8 @@ QString Generator::typeString(const Node *node) case Node::Union: return "union"; case Node::QmlType: - return "type"; case Node::QmlBasicType: + case Node::JsBasicType: return "type"; case Node::Page: return "documentation"; diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h index fd5fbbcef..f28432bd2 100644 --- a/src/qdoc/generator.h +++ b/src/qdoc/generator.h @@ -63,6 +63,7 @@ public: virtual void initializeGenerator(); virtual void initializeFormat(); virtual void terminateGenerator(); + virtual QString typeString(const Node *node); QString fullDocumentLocation(const Node *node, bool useSubdir = false); QString linkForExampleFile(const QString &path, const Node *parent, @@ -118,7 +119,6 @@ protected: virtual bool generateText(const Text &text, const Node *relative, CodeMarker *marker); virtual QString imageFileName(const Node *relative, const QString &fileBase); virtual int skipAtoms(const Atom *atom, Atom::AtomType type) const; - virtual QString typeString(const Node *node); static bool matchAhead(const Atom *atom, Atom::AtomType expectedAtomType); static QString outputPrefix(const Node *node); diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp index 019604ce7..a372ea762 100644 --- a/src/qdoc/helpprojectwriter.cpp +++ b/src/qdoc/helpprojectwriter.cpp @@ -92,7 +92,6 @@ void HelpProjectWriter::reset(const QString &defaultFileName, Generator *g) + Config::dot + "filterAttributes"); project.customFilters[name] = QSet(filters.cbegin(), filters.cend()); } - // customFilters = config.defs. const auto excludedPrefixes = config.getStringSet(prefix + "excluded"); for (auto name : excludedPrefixes) @@ -103,6 +102,8 @@ void HelpProjectWriter::reset(const QString &defaultFileName, Generator *g) SubProject subproject; QString subprefix = prefix + "subprojects" + Config::dot + name + Config::dot; subproject.title = config.getString(subprefix + "title"); + if (subproject.title.isEmpty()) + continue; subproject.indexTitle = config.getString(subprefix + "indexTitle"); subproject.sortPages = config.getBool(subprefix + "sortPages"); subproject.type = config.getString(subprefix + "type"); @@ -129,8 +130,8 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList typeHash["union"] = Node::Union; typeHash["header"] = Node::HeaderFile; typeHash["headerfile"] = Node::HeaderFile; - typeHash["doc"] = Node::Page; // to be removed from qdocconf files - typeHash["fake"] = Node::Page; // to be removed from qdocconf files + typeHash["doc"] = Node::Page; // Unused (supported but ignored as a prefix) + typeHash["fake"] = Node::Page; // Unused (supported but ignored as a prefix) typeHash["page"] = Node::Page; typeHash["enum"] = Node::Enum; typeHash["example"] = Node::Example; @@ -149,41 +150,26 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList typeHash["qmltype"] = Node::QmlType; typeHash["qmlbasictype"] = Node::QmlBasicType; - QHash pageTypeHash; - pageTypeHash["example"] = Node::Example; - pageTypeHash["headerfile"] = Node::HeaderFile; - pageTypeHash["header"] = Node::HeaderFile; - pageTypeHash["page"] = Node::Page; - pageTypeHash["externalpage"] = Node::ExternalPage; - - NodeTypeSet fullSubset; - for (auto it = pageTypeHash.constBegin(); it != pageTypeHash.constEnd(); ++it) - fullSubset.insert(it.value()); - for (const QString &selector : selectors) { QStringList pieces = selector.split(QLatin1Char(':')); - if (pieces.size() == 1) { - QString lower = selector.toLower(); - if (typeHash.contains(lower)) - subproject.selectors[typeHash[lower]] = fullSubset; - } else if (pieces.size() >= 2) { - QString pageTypeStr = pieces[0].toLower(); - pieces = pieces[1].split(QLatin1Char(',')); - if (typeHash.contains(pageTypeStr)) { - NodeTypeSet nodeTypeSet; - for (int i = 0; i < pieces.size(); ++i) { - QString piece = pieces[i].toLower(); - if (typeHash[pageTypeStr] == Node::Group - || typeHash[pageTypeStr] == Node::Module - || typeHash[pageTypeStr] == Node::QmlModule - || typeHash[pageTypeStr] == Node::JsModule) { - subproject.groups << piece; - continue; - } - if (pageTypeHash.contains(piece)) - nodeTypeSet.insert(pageTypeHash[piece]); + // Remove doc: or fake: prefix + if (pieces.size() > 1 && typeHash.value(pieces[0].toLower()) == Node::Page) + pieces.takeFirst(); + + QString typeName = pieces.takeFirst().toLower(); + if (!typeHash.contains(typeName)) + continue; + + subproject.selectors << typeHash.value(typeName); + if (!pieces.isEmpty()) { + pieces = pieces[0].split(QLatin1Char(',')); + for (const auto &piece : qAsConst(pieces)) { + if (typeHash[typeName] == Node::Group + || typeHash[typeName] == Node::Module + || typeHash[typeName] == Node::QmlModule + || typeHash[typeName] == Node::JsModule) { + subproject.groups << piece.toLower(); } - subproject.selectors[typeHash[pageTypeStr]] = nodeTypeSet; } } } @@ -268,7 +254,7 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QXmlStreamWriter & project.subprojects[i].nodes[objName] = node; } else if (subproject.selectors.contains(node->nodeType())) { // Add all group members for '[group|module|qmlmodule]:name' selector - if (node->isGroup() || node->isModule() || node->isQmlModule()) { + if (node->isCollectionNode()) { if (project.subprojects[i].groups.contains(node->name().toLower())) { const CollectionNode *cn = static_cast(node); const auto members = cn->members(); @@ -277,20 +263,15 @@ bool HelpProjectWriter::generateSection(HelpProject &project, QXmlStreamWriter & m->isTextPageNode() ? m->fullTitle() : m->fullDocumentName(); project.subprojects[i].nodes[memberName] = m; } + continue; + } else if (!project.subprojects[i].groups.isEmpty()) { + continue; // Node does not represent specified group(s) } + } else if (node->isTextPageNode()) { + if (node->isExternalPage() || node->fullTitle().isEmpty()) + continue; } - // Accept only the node types in the selectors hash. - else if (!node->isTextPageNode()) - project.subprojects[i].nodes[objName] = node; - else { - // Accept only doc nodes with subtypes contained in the selector's - // mask. - if (subproject.selectors[node->nodeType()].contains(node->nodeType()) - && !node->isExternalPage() && !node->fullTitle().isEmpty()) { - - project.subprojects[i].nodes[objName] = node; - } - } + project.subprojects[i].nodes[objName] = node; } } @@ -537,6 +518,9 @@ void HelpProjectWriter::writeSection(QXmlStreamWriter &writer, const QString &pa */ void HelpProjectWriter::addMembers(HelpProject &project, QXmlStreamWriter &writer, const Node *node) { + if (node->isQmlBasicType() || node->isJsBasicType()) + return; + QString href = gen_->fullDocumentLocation(node, false); href = href.left(href.size() - 5); if (href.isEmpty()) @@ -570,58 +554,41 @@ void HelpProjectWriter::writeNode(HelpProject &project, QXmlStreamWriter &writer case Node::Class: case Node::Struct: case Node::Union: + case Node::QmlType: + case Node::JsType: + case Node::QmlBasicType: + case Node::JsBasicType: { + QString typeStr = gen_->typeString(node); + if (!typeStr.isEmpty()) + typeStr[0] = typeStr[0].toTitleCase(); writer.writeStartElement("section"); writer.writeAttribute("ref", href); if (node->parent() && !node->parent()->name().isEmpty()) writer.writeAttribute( - "title", tr("%1::%2 Class Reference").arg(node->parent()->name()).arg(objName)); + "title", tr("%1::%2 %3 Reference").arg(node->parent()->name()).arg(objName).arg(typeStr)); else - writer.writeAttribute("title", tr("%1 Class Reference").arg(objName)); + writer.writeAttribute("title", tr("%1 %2 Reference").arg(objName).arg(typeStr)); addMembers(project, writer, node); writer.writeEndElement(); // section - break; + } break; case Node::Namespace: writeSection(writer, href, objName); break; + case Node::Example: case Node::HeaderFile: - writer.writeStartElement("section"); - writer.writeAttribute("ref", href); - writer.writeAttribute("title", node->fullTitle()); - addMembers(project, writer, node); - writer.writeEndElement(); // section - break; - - case Node::JsType: - case Node::QmlType: - writer.writeStartElement("section"); - writer.writeAttribute("ref", href); - writer.writeAttribute("title", tr("%1 Type Reference").arg(node->fullTitle())); - addMembers(project, writer, node); - writer.writeEndElement(); // section - break; - - case Node::Page: { - // Page nodes (such as manual pages) contain subtypes, titles and other - // attributes. - const PageNode *pn = static_cast(node); - - writer.writeStartElement("section"); - writer.writeAttribute("ref", href); - writer.writeAttribute("title", pn->fullTitle()); - - writer.writeEndElement(); // section - } break; + case Node::Page: case Node::Group: case Node::Module: case Node::JsModule: case Node::QmlModule: { - const CollectionNode *cn = static_cast(node); writer.writeStartElement("section"); writer.writeAttribute("ref", href); - writer.writeAttribute("title", cn->fullTitle()); + writer.writeAttribute("title", node->fullTitle()); + if (node->nodeType() == Node::HeaderFile) + addMembers(project, writer, node); writer.writeEndElement(); // section } break; default:; diff --git a/src/qdoc/helpprojectwriter.h b/src/qdoc/helpprojectwriter.h index eedfa3909..31b8f009d 100644 --- a/src/qdoc/helpprojectwriter.h +++ b/src/qdoc/helpprojectwriter.h @@ -44,11 +44,9 @@ using NodeTypeSet = QSet; struct SubProject { - using NodeTypeToSet = QHash; - QString title; QString indexTitle; - NodeTypeToSet selectors; + NodeTypeSet selectors; bool sortPages; QString type; QHash nodes; diff --git a/tests/auto/qdoc/generatedoutput/expected_output/test.qhp b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp new file mode 100644 index 000000000..4816ef1d5 --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/test.qhp @@ -0,0 +1,137 @@ + + + org.qt-project.test.001 + test + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + qdoc-test-qmlmodule.html + qml-int.html + qml-qdoc-test-abstractparent-members.html + qml-qdoc-test-abstractparent.html + qml-qdoc-test-child-members.html + qml-qdoc-test-child.html + qml-qdoc-test-doctest-members.html + qml-qdoc-test-doctest.html + qml-qdoc-test-type-members.html + qml-qdoc-test-type.html + qml-uicomponents-progressbar-members.html + qml-uicomponents-progressbar.html + qml-uicomponents-switch-members.html + qml-uicomponents-switch.html + qml-uicomponents-tabwidget-members.html + qml-uicomponents-tabwidget.html + test-componentset-componentset-pro.html + test-componentset-example.html + test-componentset-progressbar-qml.html + test-componentset-switch-qml.html + test-componentset-tabwidget-qml.html + testcpp-module.html + testqdoc-test-members.html + testqdoc-test-obsolete.html + testqdoc-test.html + testqdoc-testderived-members.html + testqdoc-testderived.html + testqdoc.html + uicomponents-qmlmodule.html + + + diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf index b4598476e..a1ed619a3 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/examples-qhp.qdocconf @@ -1,5 +1,6 @@ # QML test includes a documented example include(testqml.qdocconf) +version = 0.0.1 examplesinstallpath = test @@ -12,6 +13,22 @@ qhp.Test.virtualFolder = test qhp.Test.indexTitle = UI Components qhp.Test.indexRoot = +qhp.Test.subprojects = test classes qmltypes undefined +qhp.Test.subprojects.test.title = Test +qhp.Test.subprojects.test.indexTitle = UI Components +qhp.Test.subprojects.test.selectors = doc:page fake:example module qmlmodule +qhp.Test.subprojects.test.sortPages = true + +qhp.Test.subprojects.classes.title = Classes +qhp.Test.subprojects.classes.indexTitle = QDoc Test C++ Classes +qhp.Test.subprojects.classes.selectors = class namespace doc:headerfile boop:whatever +qhp.Test.subprojects.classes.sortPages = true + +qhp.Test.subprojects.qmltypes.title = QML Types +qhp.Test.subprojects.qmltypes.indexTitle = UI Components +qhp.Test.subprojects.qmltypes.selectors = qmlmodule:UIComponents,QDoc.Test +qhp.Test.subprojects.qmltypes.sortPages = true + # Add some meta-data to the example manifestmeta.filters = test diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index b3509dfff..20becc713 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -56,7 +56,7 @@ private slots: void docBookFromQml(); // Output format independent tests - void examplesManifestXml(); + void examplesManifestXmlAndQhp(); void ignoresinceVariable(); void templateParameters(); void scopedEnum(); @@ -286,9 +286,11 @@ void tst_generatedOutput::docBookFromQml() "docbook/qml-int.xml"); } -void tst_generatedOutput::examplesManifestXml() +void tst_generatedOutput::examplesManifestXmlAndQhp() { - testAndCompare("testdata/configs/examples-qhp.qdocconf", "examples-manifest.xml"); + testAndCompare("testdata/configs/examples-qhp.qdocconf", + "examples-manifest.xml " + "test.qhp"); } void tst_generatedOutput::ignoresinceVariable() -- cgit v1.2.3 From fffed819ca8efeee79698aae07b27741f004f7e2 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 14 Feb 2020 11:14:27 +0100 Subject: qdoc: Refactor automatic note generation for function nodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Function nodes may have a number of automatically generated notes added to the documentation; as they share the same formatting, collect them into a single virtual function in Generator, and override it in DocBookGenerator. Call the virtual function in Generator::generateBody() after generating the text for the Doc instance. As we append the notes to the body, the order in which the notes appear may change slightly (if a function comment generates multiple notes). Add \note commands in the tests in preparation for a follow-up commit that utilizes the refactored code. Task-number: QTBUG-37355 Change-Id: Id92926e53b61e03a2d2feceda70987191b708975 Reviewed-by: Topi Reiniö --- src/qdoc/docbookgenerator.cpp | 141 ++++++++++----------- src/qdoc/docbookgenerator.h | 4 +- src/qdoc/generator.cpp | 119 +++++++++++------ src/qdoc/generator.h | 4 +- src/qdoc/htmlgenerator.cpp | 55 +------- src/qdoc/htmlgenerator.h | 1 - .../expected_output/docbook/qml-qdoc-test-type.xml | 6 + .../expected_output/qml-qdoc-test-type.html | 2 + .../qdoc/generatedoutput/testdata/qml/type.cpp | 4 + 9 files changed, 167 insertions(+), 169 deletions(-) diff --git a/src/qdoc/docbookgenerator.cpp b/src/qdoc/docbookgenerator.cpp index 5f8d961f8..e8cc2c859 100644 --- a/src/qdoc/docbookgenerator.cpp +++ b/src/qdoc/docbookgenerator.cpp @@ -2076,27 +2076,28 @@ bool DocBookGenerator::generateThreadSafeness(const Node *node) void DocBookGenerator::generateBody(const Node *node) { // From Generator::generateBody, without warnings. + const FunctionNode *fn = node->isFunction() ? static_cast(node) : nullptr; + if (!node->hasDoc() && !node->hasSharedDoc()) { /* Test for special function, like a destructor or copy constructor, that has no documentation. */ - if (node->nodeType() == Node::Function) { - const auto func = static_cast(node); + if (fn) { QString t; - if (func->isDtor()) { - t = "Destroys the instance of " + func->parent()->name() + "."; - if (func->isVirtual()) + if (fn->isDtor()) { + t = "Destroys the instance of " + fn->parent()->name() + "."; + if (fn->isVirtual()) t += " The destructor is virtual."; - } else if (func->isCtor()) { - t = "Default constructs an instance of " + func->parent()->name() + "."; - } else if (func->isCCtor()) { + } else if (fn->isCtor()) { + t = "Default constructs an instance of " + fn->parent()->name() + "."; + } else if (fn->isCCtor()) { t = "Copy constructor."; - } else if (func->isMCtor()) { + } else if (fn->isMCtor()) { t = "Move-copy constructor."; - } else if (func->isCAssign()) { + } else if (fn->isCAssign()) { t = "Copy-assignment constructor."; - } else if (func->isMAssign()) { + } else if (fn->isMAssign()) { t = "Move-assignment constructor."; } @@ -2104,10 +2105,9 @@ void DocBookGenerator::generateBody(const Node *node) writer->writeTextElement(dbNamespace, "para", t); } } else if (!node->isSharingComment()) { - if (node->nodeType() == Node::Function) { - const auto func = static_cast(node); - if (!func->overridesThis().isEmpty()) - generateReimplementsClause(func); + if (fn) { + if (!fn->overridesThis().isEmpty()) + generateReimplementsClause(fn); } if (!generateText(node->doc().body(), node)) { @@ -2115,6 +2115,15 @@ void DocBookGenerator::generateBody(const Node *node) return; } + if (fn) { + if (fn->isPrivateSignal()) + generateAddendum(node, PrivateSignal); + if (fn->isInvokable()) + generateAddendum(node, Invokable); + if (fn->hasAssociatedProperties()) + generateAddendum(node, AssociatedProperties); + } + // Warning generation skipped with respect to Generator::generateBody. } @@ -3393,83 +3402,70 @@ void DocBookGenerator::generateOverloadedSignal(const Node *node) } /*! - Generates a bold line that explains that this is a private signal, - only made public to let users pass it to connect(). - */ -void DocBookGenerator::generatePrivateSignalNote() -{ - // From Generator::generatePrivateSignalNote. - writer->writeStartElement(dbNamespace, "note"); - newLine(); - writer->writeTextElement(dbNamespace, "para", - "This is a private signal. It can be used in signal connections but " - "cannot be emitted by the user."); - writer->writeEndElement(); // note - newLine(); -} - -/*! - Generates a bold line that says: - "This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE." - */ -void DocBookGenerator::generateInvokableNote(const Node *node) + Generates an addendum note of type \a type for \a node. \a marker + is unused in this generator. +*/ +void DocBookGenerator::generateAddendum(const Node *node, Addendum type, CodeMarker *marker) { - // From Generator::generateInvokableNote. + Q_UNUSED(marker); + Q_ASSERT(node && !node->name().isEmpty()); writer->writeStartElement(dbNamespace, "note"); newLine(); - writer->writeStartElement(dbNamespace, "para"); - writer->writeCharacters( + switch (type) { + case Invokable: + writer->writeStartElement(dbNamespace, "para"); + writer->writeCharacters( "This function can be invoked via the meta-object system and from QML. See "); - generateSimpleLink(node->url(), "Q_INVOKABLE"); - writer->writeCharacters("."); - writer->writeEndElement(); // para - newLine(); - writer->writeEndElement(); // note - newLine(); -} - -/*! - Generates bold Note lines that explain how function \a fn - is associated with each of its associated properties. - */ -void DocBookGenerator::generateAssociatedPropertyNotes(const FunctionNode *fn) -{ - // From HtmlGenerator::generateAssociatedPropertyNotes. - if (fn->hasAssociatedProperties()) { - writer->writeStartElement(dbNamespace, "note"); + generateSimpleLink(node->url(), "Q_INVOKABLE"); + writer->writeCharacters("."); + writer->writeEndElement(); // para newLine(); - writer->writeStartElement(dbNamespace, "para"); - + break; + case PrivateSignal: + writer->writeTextElement(dbNamespace, "para", + "This is a private signal. It can be used in signal connections but " + "cannot be emitted by the user."); + break; + case AssociatedProperties: + { + if (!node->isFunction()) + return; + const FunctionNode *fn = static_cast(node); NodeList nodes = fn->associatedProperties(); + if (nodes.isEmpty()) + return; std::sort(nodes.begin(), nodes.end(), Node::nodeNameLessThan); for (const auto node : qAsConst(nodes)) { QString msg; const auto pn = static_cast(node); switch (pn->role(fn)) { case PropertyNode::Getter: - msg = QStringLiteral("Getter function "); + msg = QStringLiteral("Getter function"); break; case PropertyNode::Setter: - msg = QStringLiteral("Setter function "); + msg = QStringLiteral("Setter function"); break; case PropertyNode::Resetter: - msg = QStringLiteral("Resetter function "); + msg = QStringLiteral("Resetter function"); break; case PropertyNode::Notifier: - msg = QStringLiteral("Notifier signal "); + msg = QStringLiteral("Notifier signal"); break; default: - break; + continue; } - writer->writeCharacters(msg + "for property "); + writer->writeCharacters(msg + " for property "); generateSimpleLink(linkForNode(pn, nullptr), pn->name()); writer->writeCharacters(". "); } - writer->writeEndElement(); // para - newLine(); - writer->writeEndElement(); // note - newLine(); + break; } + default: + break; + } + + writer->writeEndElement(); // note + newLine(); } void DocBookGenerator::generateDetailedMember(const Node *node, const PageNode *relative) @@ -3568,13 +3564,6 @@ void DocBookGenerator::generateDetailedMember(const Node *node, const PageNode * newLine(); generateSectionList(notifiers, node); } - } else if (node->isFunction()) { - const auto fn = static_cast(node); - if (fn->isPrivateSignal()) - generatePrivateSignalNote(); - if (fn->isInvokable()) - generateInvokableNote(node); - generateAssociatedPropertyNotes(fn); } else if (node->isEnumType()) { const auto en = static_cast(node); @@ -3646,9 +3635,9 @@ void DocBookGenerator::generateSectionList(const Section §ion, const Node *r newLine(); if (hasPrivateSignals) - generatePrivateSignalNote(); + generateAddendum(relative, Generator::PrivateSignal); if (isInvokable) - generateInvokableNote(relative); + generateAddendum(relative, Generator::Invokable); } if (status != Section::Obsolete && section.style() == Section::Summary diff --git a/src/qdoc/docbookgenerator.h b/src/qdoc/docbookgenerator.h index 9a223f4af..5eea595f7 100644 --- a/src/qdoc/docbookgenerator.h +++ b/src/qdoc/docbookgenerator.h @@ -81,6 +81,7 @@ protected: bool generateStatus(const Node *node); bool generateThreadSafeness(const Node *node); bool generateSince(const Node *node); + void generateAddendum(const Node *node, Generator::Addendum type, CodeMarker *marker = nullptr) override; using Generator::generateBody; void generateBody(const Node *node); @@ -133,9 +134,6 @@ private: void generateExampleFilePage(const Node *en, const QString &file, CodeMarker *marker = nullptr) override; void generateOverloadedSignal(const Node *node); - void generatePrivateSignalNote(); - void generateInvokableNote(const Node *node); - void generateAssociatedPropertyNotes(const FunctionNode *fn); bool generateQmlText(const Text &text, const Node *relative, CodeMarker *marker = nullptr, const QString &qmlName = QString()) override; void generateRequiredLinks(const Node *node); diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 3e689c4b5..f8fb9ad02 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -759,55 +759,55 @@ const Atom *Generator::generateAtomList(const Atom *atom, const Node *relative, */ void Generator::generateBody(const Node *node, CodeMarker *marker) { + const FunctionNode *fn = node->isFunction() ? static_cast(node) : nullptr; if (!node->hasDoc() && !node->hasSharedDoc()) { /* Test for special function, like a destructor or copy constructor, that has no documentation. */ - if (node->isFunction()) { - const FunctionNode *func = static_cast(node); - if (func->isDtor()) { + if (fn) { + if (fn->isDtor()) { Text text; text << "Destroys the instance of "; - text << func->parent()->name() << "."; - if (func->isVirtual()) + text << fn->parent()->name() << "."; + if (fn->isVirtual()) text << " The destructor is virtual."; out() << "

"; generateText(text, node, marker); out() << "

"; - } else if (func->isCtor()) { + } else if (fn->isCtor()) { Text text; text << "Default constructs an instance of "; - text << func->parent()->name() << "."; + text << fn->parent()->name() << "."; out() << "

"; generateText(text, node, marker); out() << "

"; - } else if (func->isCCtor()) { + } else if (fn->isCCtor()) { Text text; text << "Copy constructor."; out() << "

"; generateText(text, node, marker); out() << "

"; - } else if (func->isMCtor()) { + } else if (fn->isMCtor()) { Text text; text << "Move-copy constructor."; out() << "

"; generateText(text, node, marker); out() << "

"; - } else if (func->isCAssign()) { + } else if (fn->isCAssign()) { Text text; text << "Copy-assignment operator."; out() << "

"; generateText(text, node, marker); out() << "

"; - } else if (func->isMAssign()) { + } else if (fn->isMAssign()) { Text text; text << "Move-assignment operator."; out() << "

"; generateText(text, node, marker); out() << "

"; } else if (!node->isWrapper() && !node->isMarkedReimp()) { - if (!func->isIgnored()) // undocumented functions added by Q_OBJECT + if (!fn->isIgnored()) // undocumented functions added by Q_OBJECT node->location().warning( tr("No documentation for '%1'").arg(node->plainSignature())); } @@ -818,8 +818,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) tr("No documentation for '%1'").arg(node->plainSignature())); } } else if (!node->isSharingComment()) { - if (node->isFunction()) { - const FunctionNode *fn = static_cast(node); + if (fn) { if (!fn->overridesThis().isEmpty()) generateReimplementsClause(fn, marker); } @@ -829,6 +828,16 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) return; } + if (fn) { + if (fn->isPrivateSignal()) + generateAddendum(node, PrivateSignal, marker); + if (fn->isInvokable()) + generateAddendum(node, Invokable, marker); + if (fn->hasAssociatedProperties()) + generateAddendum(node, AssociatedProperties, marker); + } + + // Generate warnings if (node->isEnumType()) { const EnumNode *enume = static_cast(node); @@ -860,8 +869,7 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) } } } - } else if (node->isFunction()) { - const FunctionNode *fn = static_cast(node); + } else if (fn) { const QSet declaredNames = fn->parameters().getNames(); const QSet documentedNames = fn->doc().parameterNames(); if (declaredNames != documentedNames) { @@ -1344,33 +1352,66 @@ void Generator::generateStatus(const Node *node, CodeMarker *marker) } /*! - Generates a bold line that explains that this is a private signal, - only made public to let users pass it to connect(). - */ -void Generator::generatePrivateSignalNote(const Node *node, CodeMarker *marker) + Generates an addendum note of type \a type for \a node, using \a marker + as the code marker. +*/ +void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *marker) { + Q_ASSERT(node && !node->name().isEmpty()); Text text; text << Atom::ParaLeft << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "Note: " << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << "This is a private signal. It can be used in signal connections but cannot be emitted " - "by the user." - << Atom::ParaRight; - generateText(text, node, marker); -} + << "Note: " << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD); + + switch (type) { + case Invokable: + text << "This function can be invoked via the meta-object system and from QML. See " + << Atom(Atom::Link, "Q_INVOKABLE") + << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) << "Q_INVOKABLE" + << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK) << "."; + break; + case PrivateSignal: + text << "This is a private signal. It can be used in signal connections " + "but cannot be emitted by the user."; + break; + case AssociatedProperties: + { + if (!node->isFunction()) + return; + const FunctionNode *fn = static_cast(node); + NodeList nodes = fn->associatedProperties(); + if (nodes.isEmpty()) + return; + std::sort(nodes.begin(), nodes.end(), Node::nodeNameLessThan); + for (const auto *n : qAsConst(nodes)) { + QString msg; + const PropertyNode *pn = static_cast(n); + switch (pn->role(fn)) { + case PropertyNode::Getter: + msg = QStringLiteral("Getter function"); + break; + case PropertyNode::Setter: + msg = QStringLiteral("Setter function"); + break; + case PropertyNode::Resetter: + msg = QStringLiteral("Resetter function"); + break; + case PropertyNode::Notifier: + msg = QStringLiteral("Notifier signal"); + break; + default: + continue; + } + text << msg << " for property " << Atom(Atom::Link, pn->name()) + << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) << pn->name() + << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK) << ". "; + } + break; + } + default: + return; + } -/*! - Generates a bold line that says: - "This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE." - */ -void Generator::generateInvokableNote(const Node *node, CodeMarker *marker) -{ - Text text; - text << Atom::ParaLeft << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD) - << "Note: " << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD) - << "This function can be invoked via the meta-object system and from QML. See " - << Atom(Atom::Link, "Q_INVOKABLE") << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) - << "Q_INVOKABLE" << Atom(Atom::FormattingRight, ATOM_FORMATTING_LINK) << "." - << Atom::ParaRight; + text << Atom::ParaRight; generateText(text, node, marker); } diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h index f28432bd2..d72a77bd1 100644 --- a/src/qdoc/generator.h +++ b/src/qdoc/generator.h @@ -53,6 +53,7 @@ class Generator public: enum ListType { Generic, Obsolete }; + enum Addendum { Invokable, PrivateSignal, AssociatedProperties }; Generator(); virtual ~Generator(); @@ -140,8 +141,7 @@ protected: static QString formatSince(const Node *node); void generateSince(const Node *node, CodeMarker *marker); void generateStatus(const Node *node, CodeMarker *marker); - void generatePrivateSignalNote(const Node *node, CodeMarker *marker); - void generateInvokableNote(const Node *node, CodeMarker *marker); + virtual void generateAddendum(const Node *node, Addendum type, CodeMarker *marker); void generateThreadSafeness(const Node *node, CodeMarker *marker); QString getMetadataElement(const Aggregate *inner, const QString &t); QStringList getMetadataElements(const Aggregate *inner, const QString &t); diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index e7f4dc1cb..c440b31c3 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -829,7 +829,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark out() << formattingRightMap()[ATOM_FORMATTING_BOLD]; break; case Atom::NoteRight: - out() << "

"; + out() << "

\n"; break; case Atom::LegaleseLeft: out() << "
"; @@ -3114,10 +3114,12 @@ void HtmlGenerator::generateSectionList(const Section §ion, const Node *rela if (twoColumn) out() << "\n
\n"; } - if (hasPrivateSignals && alignNames) - generatePrivateSignalNote(relative, marker); - if (isInvokable && alignNames) - generateInvokableNote(relative, marker); + if (alignNames) { + if (hasPrivateSignals) + generateAddendum(relative, Generator::PrivateSignal, marker); + if (isInvokable) + generateAddendum(relative, Generator::Invokable, marker); + } } if (status != Section::Obsolete && section.style() == Section::Summary @@ -3502,13 +3504,6 @@ void HtmlGenerator::generateDetailedMember(const Node *node, const PageNode *rel out() << "

Notifier signal:

\n"; generateSectionList(notifiers, node, marker); } - } else if (node->isFunction()) { - const FunctionNode *fn = static_cast(node); - if (fn->isPrivateSignal()) - generatePrivateSignalNote(node, marker); - if (fn->isInvokable()) - generateInvokableNote(node, marker); - generateAssociatedPropertyNotes(const_cast(fn)); } else if (node->isEnumType()) { const EnumNode *etn = static_cast(node); if (etn->flagsType()) { @@ -4211,40 +4206,4 @@ QXmlStreamWriter &HtmlGenerator::xmlWriter() return *xmlWriterStack.top(); } -/*! - Generates bold Note lines that explain how function \a fn - is associated with each of its associated properties. - */ -void HtmlGenerator::generateAssociatedPropertyNotes(const FunctionNode *fn) -{ - if (fn->hasAssociatedProperties()) { - out() << "

Note: "; - NodeList nodes = fn->associatedProperties(); - std::sort(nodes.begin(), nodes.end(), Node::nodeNameLessThan); - for (const auto *node : qAsConst(nodes)) { - QString msg; - const PropertyNode *pn = static_cast(node); - switch (pn->role(fn)) { - case PropertyNode::Getter: - msg = QStringLiteral("Getter function "); - break; - case PropertyNode::Setter: - msg = QStringLiteral("Setter function "); - break; - case PropertyNode::Resetter: - msg = QStringLiteral("Resetter function "); - break; - case PropertyNode::Notifier: - msg = QStringLiteral("Notifier signal "); - break; - default: - break; - } - QString link = linkForNode(pn, nullptr); - out() << msg << "for property " << pn->name() << ". "; - } - out() << "

"; - } -} - QT_END_NAMESPACE diff --git a/src/qdoc/htmlgenerator.h b/src/qdoc/htmlgenerator.h index ea50e4baf..c1a47ba33 100644 --- a/src/qdoc/htmlgenerator.h +++ b/src/qdoc/htmlgenerator.h @@ -81,7 +81,6 @@ protected: void generateManifestFile(const QString &manifest, const QString &element); void readManifestMetaContent(); void generateKeywordAnchors(const Node *node); - void generateAssociatedPropertyNotes(const FunctionNode *fn); private: enum SubTitleSize { SmallSubTitle, LargeSubTitle }; diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml index 1ab15056a..59ed97a01 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-type.xml @@ -135,6 +135,9 @@ completed(status) This signal is emitted when the operation completed with status. + +The corresponding handler is onCompleted. + @@ -142,6 +145,9 @@ configured() This attached signal is emitted when the type was configured. + +The corresponding handler is onConfigured. + 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 166cbee81..f18e97082 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 @@ -143,6 +143,7 @@ completed(status)

This signal is emitted when the operation completed with status.

+

Note: The corresponding handler is onCompleted.


Attached Signal Documentation

@@ -154,6 +155,7 @@ configured()

This attached signal is emitted when the type was configured.

+

Note: The corresponding handler is onConfigured.


Method Documentation

diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp index bf04bdb43..10a310a87 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp @@ -92,10 +92,14 @@ \qmlsignal Type::completed(int status) This signal is emitted when the operation completed with \a status. + + \note The corresponding handler is \c onCompleted. */ /*! \qmlattachedsignal Type::configured() This attached signal is emitted when the type was configured. + + \note The corresponding handler is \c onConfigured. */ -- cgit v1.2.3 From e18472fdd03a1a0633aa153ba8e579be4869fcf3 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 14 Feb 2020 11:36:16 +0100 Subject: qdoc: Add an auto-generated note in \qmlsignal documentation Construct the signal handler name and generate a note for it. This eliminates the need to maintain such notes in the source. Remove the hard-coded notes from the test source (but not from the expected output data). [ChangeLog][qdoc] QDoc now generates a note for the name of the corresponding handler in \qmlsignal documentation. Task-number: QTBUG-37355 Change-Id: Ia3ab98be909a41bde619224c9a616cb8704e258a Reviewed-by: Paul Wicking --- src/qdoc/docbookgenerator.cpp | 15 +++++++++++++++ src/qdoc/generator.cpp | 12 ++++++++++++ src/qdoc/generator.h | 2 +- tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp | 4 ---- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/qdoc/docbookgenerator.cpp b/src/qdoc/docbookgenerator.cpp index e8cc2c859..063065511 100644 --- a/src/qdoc/docbookgenerator.cpp +++ b/src/qdoc/docbookgenerator.cpp @@ -2116,6 +2116,8 @@ void DocBookGenerator::generateBody(const Node *node) } if (fn) { + if (fn->isQmlSignal()) + generateAddendum(node, QmlSignalHandler); if (fn->isPrivateSignal()) generateAddendum(node, PrivateSignal); if (fn->isInvokable()) @@ -3426,6 +3428,19 @@ void DocBookGenerator::generateAddendum(const Node *node, Addendum type, CodeMar "This is a private signal. It can be used in signal connections but " "cannot be emitted by the user."); break; + case QmlSignalHandler: + { + QString handler(node->name()); + handler[0] = handler[0].toTitleCase(); + handler.prepend(QLatin1String("on")); + writer->writeStartElement(dbNamespace, "para"); + writer->writeCharacters("The corresponding handler is "); + writer->writeTextElement(dbNamespace, "code", handler); + writer->writeCharacters("."); + writer->writeEndElement(); // para + newLine(); + break; + } case AssociatedProperties: { if (!node->isFunction()) diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index f8fb9ad02..abf0602df 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -829,6 +829,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) } if (fn) { + if (fn->isQmlSignal()) + generateAddendum(node, QmlSignalHandler, marker); if (fn->isPrivateSignal()) generateAddendum(node, PrivateSignal, marker); if (fn->isInvokable()) @@ -1373,6 +1375,16 @@ void Generator::generateAddendum(const Node *node, Addendum type, CodeMarker *ma text << "This is a private signal. It can be used in signal connections " "but cannot be emitted by the user."; break; + case QmlSignalHandler: + { + QString handler(node->name()); + handler[0] = handler[0].toTitleCase(); + handler.prepend(QLatin1String("on")); + text << "The corresponding handler is " + << Atom(Atom::FormattingLeft, ATOM_FORMATTING_TELETYPE) << handler + << Atom(Atom::FormattingRight, ATOM_FORMATTING_TELETYPE) << "."; + break; + } case AssociatedProperties: { if (!node->isFunction()) diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h index d72a77bd1..f12aff933 100644 --- a/src/qdoc/generator.h +++ b/src/qdoc/generator.h @@ -53,7 +53,7 @@ class Generator public: enum ListType { Generic, Obsolete }; - enum Addendum { Invokable, PrivateSignal, AssociatedProperties }; + enum Addendum { Invokable, PrivateSignal, QmlSignalHandler, AssociatedProperties }; Generator(); virtual ~Generator(); diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp index 10a310a87..bf04bdb43 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/type.cpp @@ -92,14 +92,10 @@ \qmlsignal Type::completed(int status) This signal is emitted when the operation completed with \a status. - - \note The corresponding handler is \c onCompleted. */ /*! \qmlattachedsignal Type::configured() This attached signal is emitted when the type was configured. - - \note The corresponding handler is \c onConfigured. */ -- cgit v1.2.3 From fcd523048f02025e7563a4a6a17f6e5ff98ca6bb Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Fri, 6 Mar 2020 06:38:01 +0100 Subject: QDoc: Use correct node type string for \since in shared comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shared comment nodes were not handled as a special case when generating "This [class/function/method/type/etc] was introduced in" strings when QDoc encountered a \since command. These ended up with the default value, "documentation", which led to unexpected text in the documentation. * Add handling of shared comment nodes and get the node type from the first node in the collective. * Amend generated output test to cover this scenario. Fixes: QTBUG-82534 Change-Id: I444e95e0214f312649ec2720c23c98e698402abf Reviewed-by: Kai Koehne Reviewed-by: Topi Reiniö --- src/qdoc/generator.cpp | 4 ++++ .../qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml | 1 + .../generatedoutput/expected_output/ignoresince/testqdoc-test.html | 1 + .../generatedoutput/expected_output/scopedenum/testqdoc-test.html | 1 + .../qdoc/generatedoutput/expected_output/template/testqdoc-test.html | 1 + tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html | 1 + tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp | 1 + 7 files changed, 10 insertions(+) diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index abf0602df..bdeeec2be 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -2219,6 +2219,10 @@ QString Generator::typeString(const Node *node) case Node::JsModule: case Node::QmlModule: return "module"; + case Node::SharedComment: { + const auto &collective = static_cast(node)->collective(); + return collective.first()->nodeTypeString(); + } default: return "documentation"; } diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml index 0cfeb1724..ad6a4f30f 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml @@ -45,6 +45,7 @@ TestCPP Overloads that share a documentation comment, optionally taking a parameter b. +This function was introduced in Test 1.2.
Test::void inlineFunction() diff --git a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html index 71c54c2e9..52a10f706 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/ignoresince/testqdoc-test.html @@ -61,6 +61,7 @@

[protected] void Test::overload()

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

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

+

This function was introduced in Test 1.2.

void Test::inlineFunction()

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html index 145fc724a..3fc1f2bc7 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/scopedenum/testqdoc-test.html @@ -78,6 +78,7 @@

[protected] void Test::overload()

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

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

+

This function was introduced in Test 1.2.

void Test::inlineFunction()

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html index d19d15535..4ec52916a 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/template/testqdoc-test.html @@ -62,6 +62,7 @@

[protected] void Test::overload()

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

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

+

This function was introduced in Test 1.2.

[protected] template <typename T1, typename T2> void Test::funcTemplate(T1 a, T2 b)

diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html index f3c8d55d0..84c0c4fe3 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/testqdoc-test.html @@ -61,6 +61,7 @@

[protected] void Test::overload()

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

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

+

This function was introduced in Test 1.2.

void Test::inlineFunction()

diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp index c8b3f2f46..643a6db6a 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp @@ -155,6 +155,7 @@ void TestDerived::virtualFun() /*! \fn TestQDoc::Test::overload() \fn Test::overload(bool b) + \since Test 1.2 //! The second overload should match even without the fully qualified path Overloads that share a documentation comment, optionally taking -- cgit v1.2.3 From d7273da9c62ab13f437c72fe7e37406ed1b2413b Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Wed, 4 Mar 2020 15:16:10 +0100 Subject: QDoc: Add unit tests for Utilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-82687 Change-Id: I41219b8cdc45d7e779acfefbcd57ff352b56b88e Reviewed-by: Topi Reiniö --- tests/auto/qdoc/qdoc.pro | 3 +- tests/auto/qdoc/utilities/tst_utilities.cpp | 89 +++++++++++++++++++++++++++++ tests/auto/qdoc/utilities/utilities.pro | 12 ++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 tests/auto/qdoc/utilities/tst_utilities.cpp create mode 100644 tests/auto/qdoc/utilities/utilities.pro diff --git a/tests/auto/qdoc/qdoc.pro b/tests/auto/qdoc/qdoc.pro index d2afba2bf..c7af516ae 100644 --- a/tests/auto/qdoc/qdoc.pro +++ b/tests/auto/qdoc/qdoc.pro @@ -2,4 +2,5 @@ TEMPLATE = subdirs SUBDIRS = \ config \ - generatedoutput + generatedoutput \ + utilities diff --git a/tests/auto/qdoc/utilities/tst_utilities.cpp b/tests/auto/qdoc/utilities/tst_utilities.cpp new file mode 100644 index 000000000..0f63b1daf --- /dev/null +++ b/tests/auto/qdoc/utilities/tst_utilities.cpp @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** 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 "utilities.h" + +#include + +QT_BEGIN_NAMESPACE +Q_LOGGING_CATEGORY(lcQdoc, "qt.test") +QT_END_NAMESPACE + +class tst_Utilities : public QObject +{ + Q_OBJECT + +private slots: + void loggingCategoryName(); + void loggingCategoryDefaults(); + void startDebugging(); + void stopDebugging(); + void debugging(); +}; + +void tst_Utilities::loggingCategoryName() +{ + const QString expected = "qt.test"; + QCOMPARE(lcQdoc().categoryName(), expected); +} + +void tst_Utilities::loggingCategoryDefaults() +{ + QVERIFY(lcQdoc().isCriticalEnabled()); + QVERIFY(lcQdoc().isWarningEnabled()); + QVERIFY(!lcQdoc().isDebugEnabled()); + QVERIFY(lcQdoc().isInfoEnabled()); +} + +void tst_Utilities::startDebugging() +{ + QVERIFY(!lcQdoc().isDebugEnabled()); + Utilities::startDebugging("test"); + QVERIFY(lcQdoc().isDebugEnabled()); +} + +void tst_Utilities::stopDebugging() +{ + Utilities::startDebugging("test"); + QVERIFY(lcQdoc().isDebugEnabled()); + Utilities::stopDebugging("test"); + QVERIFY(!lcQdoc().isDebugEnabled()); +} + +void tst_Utilities::debugging() +{ + QVERIFY(!lcQdoc().isDebugEnabled()); + QVERIFY(!Utilities::debugging()); + Utilities::startDebugging("test"); + QVERIFY(lcQdoc().isDebugEnabled()); + QVERIFY(Utilities::debugging()); +} + +QTEST_APPLESS_MAIN(tst_Utilities) + +#include "tst_utilities.moc" diff --git a/tests/auto/qdoc/utilities/utilities.pro b/tests/auto/qdoc/utilities/utilities.pro new file mode 100644 index 000000000..57489f2b1 --- /dev/null +++ b/tests/auto/qdoc/utilities/utilities.pro @@ -0,0 +1,12 @@ +CONFIG += testcase +QT = core testlib +TARGET = tst_utilities +INCLUDEPATH += $$PWD/../../../../src/qdoc + +HEADERS += \ + $$PWD/../../../../src/qdoc/loggingcategory.h \ + $$PWD/../../../../src/qdoc/utilities.h + +SOURCES += \ + tst_utilities.cpp \ + $$PWD/../../../../src/qdoc/utilities.cpp -- cgit v1.2.3 From 39766fcb7b41a2065599889b3e912ca402eeb3ac Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 25 Feb 2020 14:14:36 +0100 Subject: Add tests for QDoc's prepare and generate phases The prepare test includes validating the generated .index file. Fixes: QTBUG-82716 Change-Id: I673cf39965c81cf02b8c68e0319b45c909664917 Reviewed-by: Paul Wicking --- .../generatedoutput/expected_output/testcpp.index | 39 ++++++++++++++++++++++ .../testdata/configs/testcpp.qdocconf | 1 + .../qdoc/generatedoutput/tst_generatedoutput.cpp | 18 ++++++++++ 3 files changed, 58 insertions(+) create mode 100644 tests/auto/qdoc/generatedoutput/expected_output/testcpp.index diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index new file mode 100644 index 000000000..36f8e72af --- /dev/null +++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf index 80ac58475..ff10ae4be 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf @@ -5,3 +5,4 @@ headers = ../testcpp/testcpp.h sources = ../testcpp/testcpp.cpp macro.CMDFN = \\\\fn +locationinfo = false diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 20becc713..5449a50e2 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -65,6 +65,8 @@ private slots: void crossModuleLinking(); void includeFromExampleDirs(); void singleExec(); + void preparePhase(); + void generatePhase(); private: QScopedPointer m_outputDir; @@ -359,6 +361,22 @@ void tst_generatedOutput::singleExec() "-single-exec"); } +void tst_generatedOutput::preparePhase() +{ + testAndCompare("testdata/configs/testcpp.qdocconf", + "testcpp.index", + "-prepare"); +} + +void tst_generatedOutput::generatePhase() +{ + testAndCompare("testdata/configs/testcpp.qdocconf", + "testcpp-module.html " + "testqdoc-test.html " + "testqdoc-test-members.html " + "testqdoc.html", + "-generate"); +} QTEST_APPLESS_MAIN(tst_generatedOutput) -- cgit v1.2.3 From 8180d46ba2408d57009b7f1228db032d007bf0db Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 9 Mar 2020 12:17:20 +0100 Subject: Add missing QPainterPath include ..\distancefieldmodel.h(197): error C2027: use of undefined type 'QPainterPath' Change-Id: I3c97811a14bb82bf5dabc86398ffcfc9cf4ff58d Reviewed-by: Andy Shaw --- src/distancefieldgenerator/distancefieldmodel.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/distancefieldgenerator/distancefieldmodel.h b/src/distancefieldgenerator/distancefieldmodel.h index b866e5e6a..5c71a20ab 100644 --- a/src/distancefieldgenerator/distancefieldmodel.h +++ b/src/distancefieldgenerator/distancefieldmodel.h @@ -31,6 +31,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3 From 747c2e69673a584fac4d6c0123a19a966435eadf Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 9 Mar 2020 14:33:06 +0100 Subject: QDoc: Clean up log messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If65d87e520f228997a857dbbebc13d98fa9ce994 Reviewed-by: Topi Reiniö --- src/qdoc/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index 96e93c015..d28ef2d84 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -238,12 +238,12 @@ void logStartEndMessage(const QLatin1String &startStop, const Config &config) + config.getString(CONFIG_PROJECT) + QLatin1String(" in ") + QLatin1String(config.singleExec() ? "single" : "dual") - + QLatin1String(" process mode, (") + + QLatin1String(" process mode: ") + QLatin1String(config.preparing() ? "prepare" : "generate") - + QLatin1String(" phase)"); + + QLatin1String(" phase."); const QString msg = startStop + runName; - qCInfo(lcQdoc) << msg.data(); + qCInfo(lcQdoc) << msg.toUtf8().data(); } /*! -- cgit v1.2.3 From cdd46a7d4ab2862aab286f82532356a89e43f262 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 9 Mar 2020 14:33:50 +0100 Subject: QDoc: Clean up whitespace in log messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib7dbb54c0a2d8ea7b754edc8fb7d2175471acc38 Reviewed-by: Topi Reiniö --- src/qdoc/clangcodeparser.cpp | 6 +++--- src/qdoc/main.cpp | 4 ++-- src/qdoc/qdocindexfiles.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 04fd8bd49..a0074a091 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -1310,7 +1310,7 @@ void ClangCodeParser::buildPCH() const QByteArray module = moduleHeader().toUtf8(); QByteArray header; QByteArray privateHeaderDir; - qCInfo(lcQdoc) << "Build & visit PCH for " << moduleHeader(); + qCDebug(lcQdoc) << "Build and visit PCH for" << moduleHeader(); // A predicate for std::find_if() to locate a path to the module's header // (e.g. QtGui/QtGui) to be used as pre-compiled header struct FindPredicate @@ -1413,7 +1413,7 @@ void ClangCodeParser::buildPCH() auto error = clang_saveTranslationUnit(tu, pchName_.constData(), clang_defaultSaveOptions(tu)); if (error) { - qCCritical(lcQdoc) << "Could not save PCH file for " << moduleHeader(); + qCCritical(lcQdoc) << "Could not save PCH file for" << moduleHeader(); pchName_.clear(); } else { // Visit the header now, as token from pre-compiled header won't be visited @@ -1421,7 +1421,7 @@ void ClangCodeParser::buildPCH() CXCursor cur = clang_getTranslationUnitCursor(tu); ClangVisitor visitor(qdb_, allHeaders_); visitor.visitChildren(cur); - qCInfo(lcQdoc) << "PCH built & visited for " << moduleHeader(); + qCDebug(lcQdoc) << "PCH built and visited for" << moduleHeader(); } clang_disposeTranslationUnit(tu); } else { diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index d28ef2d84..29ba75d7a 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -478,7 +478,7 @@ static void processQdocconfFile(const QString &fileName) add it to the big tree. */ parsed = 0; - qCInfo(lcQdoc) << "Parse source files for " << project; + qCInfo(lcQdoc) << "Parse source files for" << project; for (const auto &key : sources.keys()) { auto *codeParser = CodeParser::parserForSourceFile(key); if (codeParser) { @@ -487,7 +487,7 @@ static void processQdocconfFile(const QString &fileName) codeParser->parseSourceFile(config.location(), key); } } - qCInfo(lcQdoc) << "Source files parsed for " << project; + qCInfo(lcQdoc) << "Source files parsed for" << project; } /* Now the primary tree has been built from all the header and diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index f51526ab1..12136dd4a 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -1522,7 +1522,7 @@ void QDocIndexFiles::generateIndex(const QString &fileName, const QString &url, if (!file.open(QFile::WriteOnly | QFile::Text)) return; - qCInfo(lcQdoc) << "Writing index file: " << fileName; + qCInfo(lcQdoc) << "Writing index file:" << fileName; gen_ = g; QXmlStreamWriter writer(&file); -- cgit v1.2.3 From 171ecb1c48326cf3b6abad1fad317ffa0975f799 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 10 Mar 2020 14:14:59 +0100 Subject: qdoc: ClangCodeParser: Clear the stored namespace After processing a source file, we need to clear any potential stored namespace scope. Left uncleared, if the next source file is not parsed with Clang but still use ClangCodeParser::parseFnArg(), the incorrect scope is applied. Change-Id: Iba1e791ac01c0f1c699a808ce644b4edbb682399 Reviewed-by: Paul Wicking --- src/qdoc/clangcodeparser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index a0074a091..550039b2a 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -1586,6 +1586,7 @@ void ClangCodeParser::parseSourceFile(const Location & /*location*/, const QStri clang_disposeTokens(tu, tokens, numTokens); clang_disposeTranslationUnit(tu); clang_disposeIndex(index_); + namespaceScope_.clear(); } /*! -- cgit v1.2.3 From 389c544adaf005d6f205486d0470ccaf945f19f0 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 10 Mar 2020 12:22:59 +0100 Subject: qdoc: Fix regression in .index file output Commit 5234c7fc fixed an issue with missing \inmodule commands, but it ended up adding non-aggregates into the module as well which was not the intention. This caused excess nodes being listed as a module members, causing issues for the WebXML output format as well. Partially revert 5234c7fc, fix the issue correctly, and update the test for .index files. Change-Id: I85fc19152b3de8993f92361fbe1ad2fd934c79ae Reviewed-by: Paul Wicking --- src/qdoc/codeparser.cpp | 39 ++++++++++++---------- .../generatedoutput/expected_output/testcpp.index | 2 +- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/qdoc/codeparser.cpp b/src/qdoc/codeparser.cpp index db2d0df97..648a2de22 100644 --- a/src/qdoc/codeparser.cpp +++ b/src/qdoc/codeparser.cpp @@ -269,25 +269,28 @@ bool CodeParser::isParsingQdoc() const void CodeParser::checkModuleInclusion(Node *n) { if (n->physicalModuleName().isEmpty()) { - qdb_->addToModule(Generator::defaultModuleName(), n); - QString word; - switch (n->nodeType()) { - case Node::Class: - word = QLatin1String("Class"); - break; - case Node::Struct: - word = QLatin1String("Struct"); - break; - case Node::Union: - word = QLatin1String("Union"); - break; - case Node::Namespace: - word = QLatin1String("Namespace"); - break; - default: - return; - } + n->setPhysicalModuleName(Generator::defaultModuleName()); + if (n->isInAPI() && !n->name().isEmpty()) { + QString word; + switch (n->nodeType()) { + case Node::Class: + word = QLatin1String("Class"); + break; + case Node::Struct: + word = QLatin1String("Struct"); + break; + case Node::Union: + word = QLatin1String("Union"); + break; + case Node::Namespace: + word = QLatin1String("Namespace"); + break; + default: + return; + } + + qdb_->addToModule(Generator::defaultModuleName(), n); n->doc().location().warning(tr("%1 %2 has no \\inmodule command; " "using project name by default: %3") .arg(word) diff --git a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index index 36f8e72af..ae997fa52 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index +++ b/tests/auto/qdoc/generatedoutput/expected_output/testcpp.index @@ -34,6 +34,6 @@ - + -- cgit v1.2.3 From 76cc799cd2d7305afc8375a2bddbcff0ef4e18c2 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 10 Mar 2020 23:53:29 +0100 Subject: Enforce zero warnings for QDoc's generatedoutput autotest Fix all QDoc warnings for the tests and set the warning limit to zero. If any warnings are introduced, QDoc will exit with non-zero value and the test will fail. The exceptions are the tests specific to the DocBook generator, where we expect to see two warnings related to shared comment nodes. The generator currently has trouble handling these. Fixes: QTBUG-82808 Change-Id: I0482516e1e34b92592d921a4a0ffb41e4b2b4770 Reviewed-by: Paul Wicking --- .../docbook/test-componentset-example.xml | 14 +++++++------- .../expected_output/docbook/uicomponents-qmlmodule.xml | 2 +- .../expected_output/includefromexampledirs/index.html | 2 ++ .../qml-qdoc-test-abstractparent-members.html | 3 +-- .../qml-qdoc-test-abstractparent.html | 14 ++------------ .../generatedoutput/testdata/configs/docbook.qdocconf | 4 ++++ .../generatedoutput/testdata/configs/test.qdocconf | 4 ++++ .../generatedoutput/testdata/configs/testcpp.qdocconf | 5 +++++ .../includefromexampledirs/excludes/parentinclude.qdoc | 14 +------------- .../includefromexampledirs.qdocconf | 2 ++ .../includefromexampledirs/src/includefromparent.qdoc | 15 +++++++++++++++ .../testdata/qml/componentset/examples.qdoc | 18 +++++++++--------- .../qdoc/generatedoutput/testdata/testcpp/testcpp.cpp | 2 +- 13 files changed, 54 insertions(+), 45 deletions(-) diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-componentset-example.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-componentset-example.xml index 2b442d1dd..48496733b 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-componentset-example.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-componentset-example.xml @@ -10,29 +10,29 @@ 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. +The uicomponents.qdoc file generates the overview page for the UI Components module page. The generated documentation is available in the UI Components module. QML Class -The QML types use the \qmltype to document the type. In addition, they have the \inmodule command in order for QDoc to associate them to the UIComponents module. -QDoc uses the \brief command to place a basic description when listing the types. +The QML types use the \qmltype to document the type. In addition, they have the \inmodule command in order for QDoc to associate them to the UIComponents module. +QDoc uses the \brief command to place a basic description when listing the types. Properties, Signals, Handlers, and Methods The types have their properties, signals, handlers, and methods defined in their respective QML files. QDoc associates the properties and methods to the types, therefore, you only need to place the documentation above the property, method, or signal. -To document the type of a property alias, you must use the \qmlproperty command to specify the data type. +To document the type of a property alias, you must use the \qmlproperty command to specify the data type. \qmlproperty <@type>int</@type> anAliasedProperty An aliased property of type <@type>int</@type><@op>.</@op> Internal Documentation -You may declare that a documentation is for internal use by placing the \internal command after the beginning QDoc comment /*. QDoc will prevent the internal documentation from appearing in the public API. -If you wish to omit certain parts of the documentation, you may use the \omit and \endomit command. +You may declare that a documentation is for internal use by placing the \internal command after the beginning QDoc comment /*. QDoc will prevent the internal documentation from appearing in the public API. +If you wish to omit certain parts of the documentation, you may use the \omit and \endomit command. 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. +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/expected_output/docbook/uicomponents-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/uicomponents-qmlmodule.xml index f43890289..f00b3d3f7 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/uicomponents-qmlmodule.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/uicomponents-qmlmodule.xml @@ -9,7 +9,7 @@ -This is a listing of a list of UI components implemented by QML types. These files are available for general import and they are based on the Qt Quick Code Samples. +This is a listing of a list of UI components implemented by QML types. These files are available for general import and they are based on the Qt Quick Code Samples. This module is part of the UIComponents example. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html index d1fb02484..fd9fdd50a 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html +++ b/tests/auto/qdoc/generatedoutput/expected_output/includefromexampledirs/index.html @@ -20,6 +20,8 @@

QML Types

+ +

AbstractParent

Abstract base QML type

Child

A Child inheriting its parent

int

An integer basic type

Test include file that is part of the sourcedirs.

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 index 48c8fa485..f9d64de75 100644 --- 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 @@ -2,7 +2,7 @@ - + List of All Members for AbstractParent | Test @@ -11,7 +11,6 @@

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 index cbb0f36aa..f7c294ae0 100644 --- 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 @@ -2,7 +2,7 @@ - + AbstractParent QML Type | Test @@ -34,12 +34,12 @@

Methods

Detailed Description

+

Test include file that is part of the sourcedirs.

Property Documentation

@@ -54,16 +54,6 @@

Method Documentation

- -
-
- - -

-void rear(child)

-

Do some abstract parenting on child.

-
-
diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf index 6fe708176..68afd29e8 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf @@ -1,3 +1,7 @@ outputformats = DocBook DocBook.nosubdirs = true DocBook.outputsubdir = docbook + +# TODO: DocBook generator has trouble handling shared comment nodes +# allow two warnings related to these +warninglimit = 2 diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/test.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/test.qdocconf index f6473ccf7..e4cef822e 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/configs/test.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/test.qdocconf @@ -6,3 +6,7 @@ sources = ../outputfromqdocfiles/qdoctests-outputfromqdocfiles.qdoc macro.beginqdoc = "\\c {/*!}" macro.endqdoc = "\\c */" + +# zero warning tolerance +warninglimit = 0 +warninglimit.enabled = true diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf index ff10ae4be..b07aa71c0 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/testcpp.qdocconf @@ -5,4 +5,9 @@ headers = ../testcpp/testcpp.h sources = ../testcpp/testcpp.cpp macro.CMDFN = \\\\fn +macro.nothing = \\dontdocument () locationinfo = false + +# zero warning tolerance +warninglimit = 0 +warninglimit.enabled = true diff --git a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc index c95e22125..4933bc4bd 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/excludes/parentinclude.qdoc @@ -29,6 +29,7 @@ /*! //! abstract-type \qmltype AbstractParent + \inqmlmodule QDoc.Test \ingroup qmltypes \qmlabstract \brief Abstract base QML type. @@ -49,16 +50,3 @@ \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/testdata/includefromexampledirs/includefromexampledirs.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/includefromexampledirs.qdocconf index 1d981deb2..d64985942 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/includefromexampledirs.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/includefromexampledirs.qdocconf @@ -5,6 +5,8 @@ sourcedirs += src excludedirs += excludes \ ../qml/componentset +excludefiles += ../qml/parent.qdoc + exampledirs += excludes HTML.nosubdirs = true diff --git a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/src/includefromparent.qdoc b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/src/includefromparent.qdoc index 7b4c00b76..a9a526c64 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/src/includefromparent.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/includefromexampledirs/src/includefromparent.qdoc @@ -49,3 +49,18 @@ \include parent.qdocinc */ + +/*! + \qmltype Child + \inqmlmodule QDoc.Test + \ingroup qmltypes + \inherits AbstractParent + \brief A Child inheriting its parent. +*/ + +/*! + \qmlbasictype int + \inqmlmodule QDoc.Test + \ingroup qmltypes + \brief An integer basic type. +*/ diff --git a/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc b/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc index 2f56c221c..0816e624c 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc +++ b/tests/auto/qdoc/generatedoutput/testdata/qml/componentset/examples.qdoc @@ -40,18 +40,18 @@ and their public interfaces. The types are grouped into a module, the \l{UI Components} module. - The \l{componentset/uicomponents.qdoc.sample}{uicomponents.qdoc} file generates + The uicomponents.qdoc file generates the overview page for the \l{UI Components} module page. The generated documentation is available in the \l{UI Components} module. \section1 QML Class - The QML types use the \l{qmltype-command}{\\qmltype} to document the - type. In addition, they have the \l{inmodule-command}{\\inmodule} + The QML types use the \\qmltype to document the + type. In addition, they have the \\inmodule command in order for QDoc to associate them to the \c UIComponents module. - QDoc uses the \l{brief-command}{\\brief} command to place a basic + QDoc uses the \\brief command to place a basic description when listing the types. \section1 Properties, Signals, Handlers, and Methods @@ -62,7 +62,7 @@ documentation above the property, method, or signal. To document the type of a \e {property alias}, you must use the - \l{qmlproperty-command}{\\qmlproperty} command to specify the data type. + \\qmlproperty command to specify the data type. \code \qmlproperty int anAliasedProperty @@ -72,17 +72,17 @@ \section2 Internal Documentation You may declare that a documentation is for internal use by placing the - \l{internal-command}{\\internal} command after the beginning QDoc comment + \\internal command after the beginning QDoc comment \begincomment. QDoc will prevent the internal documentation from appearing in the public API. If you wish to omit certain parts of the documentation, you may use the - \l{omit-command}{\\omit} and \l{omit-command}{\\endomit} command. + \\omit and \\endomit command. \section1 QML Types with C++ Implementation This example only demonstrates the documentation for types in QML - files, but the regular \l{qml-documentation}{QML commands} may be placed + files, but the regular QML commands may be placed inside C++ classes to define the public API of the QML type. */ @@ -95,7 +95,7 @@ This is a listing of a list of UI components implemented by QML types. These files are available for general import and they are based on the - \l{Qt Quick Examples and Tutorials}{Qt Quick Code Samples}. + Qt Quick Code Samples. This module is part of the \l{componentset}{UIComponents} example. */ diff --git a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp index 643a6db6a..b1acdccf0 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp +++ b/tests/auto/qdoc/generatedoutput/testdata/testcpp/testcpp.cpp @@ -167,7 +167,7 @@ void TestDerived::virtualFun() \fn template void TestQDoc::Test::funcTemplate(T1 a, T2 b) \brief Function template with two parameters, \a a and \a b. \else - //! nothing + \nothing \endif */ -- cgit v1.2.3 From 98a4e4291da098b19a4a60fa8dbfcbdfa3b6a123 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Wed, 11 Mar 2020 11:27:19 +0100 Subject: QDoc: Add warning to use of \contentspage command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The \contentspage command doesn't produce nav links to the contents page between the next and previous pages. QDoc hasn't generated these links in html output since Qt 5.3. Remove the documentation that refers to the command and add a warning that it should not be used.. Task-number: QTBUG-75170 Change-Id: Ib16fc1cbb1e661a7519ba650e655e209c3b45b68 Reviewed-by: Topi Reiniö --- src/qdoc/cppcodeparser.cpp | 4 +++- src/qdoc/doc/files/basicqt.qdoc.sample | 3 --- src/qdoc/doc/qa-pages.qdoc | 1 - src/qdoc/doc/qdoc-manual-cmdindex.qdoc | 2 -- src/qdoc/doc/qdoc-manual-contextcmds.qdoc | 16 ---------------- src/qdoc/doc/qdoc-manual-intro.qdoc | 1 - src/qdoc/doc/qdoc-manual-markupcmds.qdoc | 10 ---------- src/qdoc/doc/qdoc-manual-qdocconf.qdoc | 9 --------- src/qdoc/doc/qdoc-manual-topiccmds.qdoc | 1 - 9 files changed, 3 insertions(+), 44 deletions(-) diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index dec081c22..647631c27 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -33,8 +33,9 @@ #include "cppcodeparser.h" #include "config.h" -#include "qdocdatabase.h" #include "generator.h" +#include "loggingcategory.h" +#include "qdocdatabase.h" #include #include @@ -559,6 +560,7 @@ void CppCodeParser::processMetaCommand(const Doc &doc, const QString &command, } } } else if (command == COMMAND_CONTENTSPAGE) { + qCWarning(lcQdoc, "(qdoc) The \\contentspage command is obsolete and should not be used."); setLink(node, Node::ContentsLink, arg); } else if (command == COMMAND_NEXTPAGE) { setLink(node, Node::NextLink, arg); diff --git a/src/qdoc/doc/files/basicqt.qdoc.sample b/src/qdoc/doc/files/basicqt.qdoc.sample index ce8df096f..1243387b2 100644 --- a/src/qdoc/doc/files/basicqt.qdoc.sample +++ b/src/qdoc/doc/files/basicqt.qdoc.sample @@ -1,6 +1,5 @@ /*! \page basicqt.html - \contentspage {Basic Qt} {Contents} \nextpage Getting Started \indexpage Index @@ -24,7 +23,6 @@ /*! \page gettingstarted.html \previouspage Basic Qt - \contentspage {Basic Qt} {Contents} \nextpage Creating Dialogs \indexpage Index @@ -40,7 +38,6 @@ / *! \page creatingdialogs.html \previouspage Getting Started - \contentspage {Basic Qt} {Contents} \indexpage Index \startpage Basic Qt diff --git a/src/qdoc/doc/qa-pages.qdoc b/src/qdoc/doc/qa-pages.qdoc index c69b1cdc6..1e3ca19f4 100644 --- a/src/qdoc/doc/qa-pages.qdoc +++ b/src/qdoc/doc/qa-pages.qdoc @@ -28,7 +28,6 @@ /*! \page 28-qdoc-qa-pages.html \previouspage The QDoc Configuration File - \contentspage QDoc Manual \nextpage QDoc Manual \title QA Pages diff --git a/src/qdoc/doc/qdoc-manual-cmdindex.qdoc b/src/qdoc/doc/qdoc-manual-cmdindex.qdoc index 672c2e409..77a3266fb 100644 --- a/src/qdoc/doc/qdoc-manual-cmdindex.qdoc +++ b/src/qdoc/doc/qdoc-manual-cmdindex.qdoc @@ -28,7 +28,6 @@ /*! \page 27-qdoc-commands-alphabetical.html \previouspage Introduction to QDoc - \contentspage QDoc Manual \nextpage Topic Commands \title Command Index @@ -49,7 +48,6 @@ \li \l {class-command} {\\class} \li \l {code-command} {\\code} \li \l {codeline-command} {\\codeline} - \li \l {contentspage-command} {\\contentspage} \li \l {default-command} {\\default} \li \l {div-command} {\\div} \li \l {dots-command} {\\dots} diff --git a/src/qdoc/doc/qdoc-manual-contextcmds.qdoc b/src/qdoc/doc/qdoc-manual-contextcmds.qdoc index f020035d3..3d69e76a6 100644 --- a/src/qdoc/doc/qdoc-manual-contextcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-contextcmds.qdoc @@ -28,7 +28,6 @@ /*! \page 14-qdoc-commands-contextcommands.html \previouspage Topic Commands - \contentspage QDoc Manual \nextpage Document Navigation \title Context Commands @@ -47,7 +46,6 @@ \list \li \l {abstract-command} {\\abstract} - \li \l {contentspage-command}{\\contentspage}, \li \l {ingroup-command}{\\ingroup}, \li \l {inherits-command}{\\inherits}, \li \l {inmodule-command}{\\inmodule}, @@ -74,7 +72,6 @@ /*! \page 15-qdoc-commands-navigation.html \previouspage Context Commands - \contentspage QDoc Manual \nextpage Status \title Document Navigation @@ -169,20 +166,11 @@ documentation. The generated link type tells browsers and search engines which document is considered by the author to be the starting point of the collection. - - \target contentspage-command - \section2 \\contentspage - - The \\contentspage command links the current page to a table of - contents page. The command follows the same syntax and argument - convention as the \l {previouspage-command} {\\previouspage} - command. */ /*! \page 16-qdoc-commands-status.html \previouspage Document Navigation - \contentspage QDoc Manual \nextpage Thread Support \title Status @@ -441,7 +429,6 @@ /*! \page 17-qdoc-commands-thread.html \previouspage Status - \contentspage QDoc Manual \nextpage Relating Things \title Thread Support @@ -621,7 +608,6 @@ /*! \page 18-qdoc-commands-relating.html \previouspage Thread Support - \contentspage QDoc Manual \nextpage Grouping Things \title Relating Things @@ -808,7 +794,6 @@ /*! \page 19-qdoc-commands-grouping.html \previouspage Relating Things - \contentspage QDoc Manual \nextpage Naming Things \title Grouping Things @@ -890,7 +875,6 @@ /*! \page 20-qdoc-commands-namingthings.html \previouspage Grouping Things - \contentspage QDoc Manual \nextpage Markup Commands \title Naming Things diff --git a/src/qdoc/doc/qdoc-manual-intro.qdoc b/src/qdoc/doc/qdoc-manual-intro.qdoc index 7ea3f1e36..a943863a6 100644 --- a/src/qdoc/doc/qdoc-manual-intro.qdoc +++ b/src/qdoc/doc/qdoc-manual-intro.qdoc @@ -27,7 +27,6 @@ /*! \page 01-qdoc-manual.html - \contentspage QDoc Manual \previouspage QDoc Manual \nextpage Command Index diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc index 386501cd3..6fc16c9e1 100644 --- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc @@ -27,7 +27,6 @@ /*! \page 03-qdoc-commands-markup.html - \contentspage QDoc Manual \previouspage Naming Things \nextpage Text Markup @@ -109,7 +108,6 @@ /*! \page 04-qdoc-commands-textmarkup.html - \contentspage QDoc Manual \previouspage Markup Commands \nextpage Document Structure @@ -659,7 +657,6 @@ /*! \page 05-qdoc-commands-documentstructure.html \previouspage Text Markup - \contentspage QDoc Manual \nextpage Including Code Inline \title Document Structure @@ -858,7 +855,6 @@ /*! \page 06-qdoc-commands-includecodeinline.html \previouspage Document Structure - \contentspage QDoc Manual \nextpage Including External Code \title Including Code Inline @@ -1091,7 +1087,6 @@ /*! \page 07-0-qdoc-commands-includingexternalcode.html \previouspage Including Code Inline - \contentspage QDoc Manual \nextpage Creating Links \title Including External Code @@ -1722,7 +1717,6 @@ /*! \page 08-qdoc-commands-creatinglinks.html \previouspage Including External Code - \contentspage QDoc Manual \nextpage Including Images \title Creating Links @@ -2119,7 +2113,6 @@ /*! \page 09-qdoc-commands-includingimages.html \previouspage Creating Links - \contentspage QDoc Manual \nextpage Tables and Lists \title Including Images @@ -2316,7 +2309,6 @@ /*! \page 10-qdoc-commands-tablesandlists.html \previouspage Including Images - \contentspage QDoc Manual \nextpage Special Content \title Tables and Lists @@ -2857,7 +2849,6 @@ /*! \page 11-qdoc-commands-specialcontent.html \previouspage Tables and Lists - \contentspage QDoc Manual \nextpage Miscellaneous \title Special Content @@ -3292,7 +3283,6 @@ /*! \page 12-0-qdoc-commands-miscellaneous.html \previouspage Special Content - \contentspage QDoc Manual \nextpage The QDoc Configuration File \title Miscellaneous diff --git a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc index 62ac13c28..d15fd5515 100644 --- a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -28,7 +28,6 @@ /*! \page 21-0-qdoc-configuration.html \previouspage Miscellaneous - \contentspage QDoc Manual \nextpage Generic Configuration Variables \title The QDoc Configuration File @@ -151,7 +150,6 @@ /*! \page 22-qdoc-configuration-generalvariables.html \previouspage The QDoc Configuration File - \contentspage QDoc Manual \nextpage Creating Help Project Files \title Generic Configuration Variables @@ -1317,7 +1315,6 @@ /*! \page 22-creating-help-project-files.html \previouspage Generic Configuration Variables - \contentspage QDoc Manual \nextpage C++ Specific Configuration Variables \title Creating Help Project Files @@ -1451,7 +1448,6 @@ /*! \page 23-qdoc-configuration-cppvariables.html \previouspage Creating Help Project Files - \contentspage QDoc Manual \nextpage Format-specific Configuration Variables \title C++ Specific Configuration Variables @@ -1562,7 +1558,6 @@ /*! \page 24-qdoc-configuration-htmlvariables.html \previouspage C++ Specific Configuration Variables - \contentspage QDoc Manual \nextpage Supporting Derived Projects \keyword HTML Specific Configuration Variables @@ -1713,7 +1708,6 @@ /*! \page 25-qdoc-configuration-derivedprojects.html \previouspage Format-specific Configuration Variables - \contentspage QDoc Manual \nextpage Example Manifest Files \title Supporting Derived Projects @@ -1871,7 +1865,6 @@ /*! \page 26-qdoc-configuration-example-manifest-files.html \previouspage Supporting Derived Projects - \contentspage QDoc Manual \title Example Manifest Files @@ -1953,7 +1946,6 @@ /*! \page 21-1-minimum-qdocconf.html \previouspage qtgui.qdocconf - \contentspage QDoc Manual \nextpage The QDoc Configuration File \title minimum.qdocconf @@ -1964,7 +1956,6 @@ /*! \page 21-2-qtgui-qdocconf.html \previouspage Supporting Derived Projects - \contentspage QDoc Manual \nextpage minimum.qdocconf \title qtgui.qdocconf diff --git a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc index cdd0c9aeb..e7405e442 100644 --- a/src/qdoc/doc/qdoc-manual-topiccmds.qdoc +++ b/src/qdoc/doc/qdoc-manual-topiccmds.qdoc @@ -28,7 +28,6 @@ /*! \page 13-qdoc-commands-topics.html \previouspage Command Index - \contentspage QDoc Manual \nextpage Context Commands \title Topic Commands -- cgit v1.2.3