From 90147027312b88cae1fd0f432ad6c8fd73426ce6 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Fri, 10 Feb 2023 05:16:10 +0100 Subject: QDoc: implement ITS attributes for parts that shouldn't be translated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch is a port of b7849d42efff91a4d247a4028d6c129f3742743a for DocBook. Pick-to: 6.5 Change-Id: I0220691da3e0827bc89e05912bcbb723d8490cf5 Reviewed-by: Paul Wicking Reviewed-by: Topi Reiniö --- src/qdoc/qdoc/docbookgenerator.cpp | 59 ++++++++++++++++++-- src/qdoc/qdoc/docbookgenerator.h | 1 + .../expected_output/docbook/cpptypes.xml | 2 +- .../docbook/qdoc-test-qmlmodule.xml | 4 +- .../qdoctests-qdocfileoutput-exhaustive.xml | 6 +-- .../docbook/qdoctests-qdocfileoutput-linking.xml | 2 +- .../docbook/qdoctests-qdocfileoutput.xml | 2 +- .../docbook/qdoctests-qdocmanuallikefileoutput.xml | 4 +- .../expected_output/docbook/qml-int.xml | 6 +-- .../docbook/qml-qdoc-test-abstractparent.xml | 10 ++-- .../docbook/qml-qdoc-test-child.xml | 10 ++-- .../docbook/qml-qdoc-test-doctest.xml | 18 +++---- .../docbook/qml-qdoc-test-oldtype.xml | 6 +-- .../expected_output/docbook/qml-qdoc-test-type.xml | 14 ++--- .../docbook/qml-qdoc-test-yetanotherchild.xml | 6 +-- .../docbook/qml-test-nover-typenoversion.xml | 6 +-- .../docbook/qml-uicomponents-progressbar.xml | 6 +-- .../docbook/qml-uicomponents-switch.xml | 6 +-- .../docbook/qml-uicomponents-tabwidget.xml | 10 ++-- .../docbook/test-componentset-example.xml | 4 +- .../docbook/test-nover-qmlmodule.xml | 4 +- .../expected_output/docbook/testcpp-module.xml | 4 +- .../expected_output/docbook/testqdoc-test.xml | 62 +++++++++++----------- .../docbook/testqdoc-testderived.xml | 16 +++--- .../expected_output/docbook/testqdoc.xml | 8 +-- .../docbook/uicomponents-qmlmodule.xml | 4 +- .../testdata/configs/docbook.qdocconf | 1 + 27 files changed, 166 insertions(+), 115 deletions(-) diff --git a/src/qdoc/qdoc/docbookgenerator.cpp b/src/qdoc/qdoc/docbookgenerator.cpp index 2b96ed2a6..115a9a6e1 100644 --- a/src/qdoc/qdoc/docbookgenerator.cpp +++ b/src/qdoc/qdoc/docbookgenerator.cpp @@ -38,6 +38,7 @@ using namespace Qt::StringLiterals; static const char dbNamespace[] = "http://docbook.org/ns/docbook"; static const char xlinkNamespace[] = "http://www.w3.org/1999/xlink"; +static const char itsNamespace[] = "http://www.w3.org/2005/11/its"; DocBookGenerator::DocBookGenerator(FileResolver& file_resolver) : XmlGenerator(file_resolver) {} @@ -158,6 +159,7 @@ void DocBookGenerator::initializeGenerator() m_buildVersion = m_config->get(CONFIG_BUILDVERSION).asString(); m_useDocBook52 = m_config->get(CONFIG_DOCBOOKEXTENSIONS).asBool() || m_config->get(format() + Config::dot + "usedocbookextensions").asBool(); + m_useITS = m_config->get(format() + Config::dot + "its").asBool(); } QString DocBookGenerator::format() @@ -324,6 +326,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) case Atom::Qml: m_writer->writeStartElement(dbNamespace, "programlisting"); m_writer->writeAttribute("language", "qml"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); m_writer->writeCharacters(removeCodeMarkers(atom->string())); m_writer->writeEndElement(); // programlisting newLine(); @@ -331,6 +335,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) case Atom::Code: m_writer->writeStartElement(dbNamespace, "programlisting"); m_writer->writeAttribute("language", "cpp"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); m_writer->writeCharacters(removeCodeMarkers(atom->string())); m_writer->writeEndElement(); // programlisting newLine(); @@ -339,6 +345,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) m_writer->writeStartElement(dbNamespace, "programlisting"); m_writer->writeAttribute("language", "cpp"); m_writer->writeAttribute("role", "bad"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); m_writer->writeCharacters(removeCodeMarkers(atom->string())); m_writer->writeEndElement(); // programlisting newLine(); @@ -381,6 +389,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) } else if (atom->string() == ATOM_FORMATTING_TELETYPE || atom->string() == ATOM_FORMATTING_PARAMETER) { m_writer->writeStartElement(dbNamespace, "code"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); if (atom->string() == ATOM_FORMATTING_PARAMETER) m_writer->writeAttribute("role", "parameter"); @@ -403,6 +413,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) } } else if (atom->string() == ATOM_FORMATTING_UICONTROL) { m_writer->writeStartElement(dbNamespace, "guilabel"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); } else { relative->location().warning(QStringLiteral("Unsupported formatting: %1").arg(atom->string())); } @@ -796,6 +808,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) m_writer->writeStartElement(dbNamespace, "td"); newLine(); m_writer->writeStartElement(dbNamespace, "para"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); generateEnumValue(pair.first, relative); m_writer->writeEndElement(); // para newLine(); @@ -809,8 +823,13 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) m_writer->writeStartElement(dbNamespace, "td"); if (itemValue.isEmpty()) m_writer->writeCharacters("?"); - else - m_writer->writeTextElement(dbNamespace, "code", itemValue); + else { + m_writer->writeStartElement(dbNamespace, "code"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); + m_writer->writeCharacters(itemValue); + m_writer->writeEndElement(); // code + } m_writer->writeEndElement(); // td newLine(); } @@ -1766,6 +1785,8 @@ qsizetype DocBookGenerator::generateAtom(const Atom *atom, const Node *relative) case Atom::UnknownCommand: m_writer->writeStartElement(dbNamespace, "emphasis"); m_writer->writeAttribute("role", "bold"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); m_writer->writeCharacters(""); m_writer->writeStartElement(dbNamespace, "code"); m_writer->writeCharacters(atom->string()); @@ -2342,11 +2363,19 @@ void DocBookGenerator::generateHeader(const QString &title, const QString &subTi // Output the DocBook header. m_writer->writeStartElement(dbNamespace, "info"); newLine(); - m_writer->writeTextElement(dbNamespace, "title", title); + m_writer->writeStartElement(dbNamespace, "title"); + if (node->genus() & Node::API && m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); + m_writer->writeCharacters(title); + m_writer->writeEndElement(); // title newLine(); if (!subTitle.isEmpty()) { - m_writer->writeTextElement(dbNamespace, "subtitle", subTitle); + m_writer->writeStartElement(dbNamespace, "subtitle"); + if (node->genus() & Node::API && m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); + m_writer->writeCharacters(subTitle); + m_writer->writeEndElement(); // subtitle newLine(); } @@ -2849,6 +2878,8 @@ void DocBookGenerator::generateRequisites(const Aggregate *aggregate) .replace(xmlAttr, " xlink:"); m_writer->writeStartElement(dbNamespace, "variablelist"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); newLine(); m_writer->device()->write(cleanOutput.toUtf8()); @@ -2888,6 +2919,8 @@ void DocBookGenerator::generateQmlRequisites(const QmlTypeNode *qcn) // Start writing the elements as a list. m_writer->writeStartElement(dbNamespace, "variablelist"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); newLine(); if (generate_import_statement) { @@ -3506,6 +3539,8 @@ QXmlStreamWriter *DocBookGenerator::startGenericDocument(const Node *node, const newLine(); m_writer->writeNamespace(dbNamespace, "db"); m_writer->writeNamespace(xlinkNamespace, "xlink"); + if (m_useITS) + m_writer->writeNamespace(itsNamespace, "its"); m_writer->writeStartElement(dbNamespace, "article"); m_writer->writeAttribute("version", "5.2"); if (!m_naturalLanguage.isEmpty()) @@ -3666,7 +3701,7 @@ void DocBookGenerator::generateDocBookSynopsis(const Node *node) // From Generator::generateStatus, HtmlGenerator::generateRequisites, // Generator::generateThreadSafeness, QDocIndexFiles::generateIndexSection. - // This function is the only place where DocBook extensions are used. + // This function is the major place where DocBook extensions are used. if (!m_useDocBook52) return; @@ -4635,6 +4670,8 @@ void DocBookGenerator::generateDetailedMember(const Node *node, const PageNode * m_writer->writeAttribute("renderas", "sect2"); writeXmlId(sharedNode); } + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); generateSynopsis(sharedNode, relative, Section::Details); @@ -4650,6 +4687,8 @@ void DocBookGenerator::generateDetailedMember(const Node *node, const PageNode * const EnumNode *etn; if (node->isEnumType() && (etn = static_cast(node))->flagsType()) { startSectionBegin(node); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); generateSynopsis(etn, relative, Section::Details); startSectionEnd(); @@ -4660,6 +4699,8 @@ void DocBookGenerator::generateDetailedMember(const Node *node, const PageNode * newLine(); } else { startSectionBegin(node); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); generateSynopsis(node, relative, Section::Details); startSectionEnd(); } @@ -4772,6 +4813,8 @@ void DocBookGenerator::generateSectionList(const Section §ion, const Node *r bool isInvokable = false; m_writer->writeStartElement(dbNamespace, "itemizedlist"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); newLine(); NodeVector::ConstIterator m = members.constBegin(); @@ -4815,6 +4858,8 @@ void DocBookGenerator::generateSectionList(const Section §ion, const Node *r if (!useObsoleteMembers && section.style() == Section::Summary && !section.inheritedMembers().isEmpty()) { m_writer->writeStartElement(dbNamespace, "itemizedlist"); + if (m_useITS) + m_writer->writeAttribute(itsNamespace, "translate", "no"); newLine(); generateSectionInheritedList(section, relative); @@ -4877,6 +4922,10 @@ void DocBookGenerator::generateQmlTypePage(QmlTypeNode *qcn) title.append(" QML Value Type"); else title.append(" QML Type"); + // TODO: for ITS attribute, only apply translate="no" on qcn->fullTitle(), + // not its suffix (which should be translated). generateHeader doesn't + // allow this kind of input, the title isn't supposed to be structured. + // Ideally, do the same in HTML. generateHeader(title, qcn->subtitle(), qcn); generateQmlRequisites(qcn); diff --git a/src/qdoc/qdoc/docbookgenerator.h b/src/qdoc/qdoc/docbookgenerator.h index be80f38c2..e00050dde 100644 --- a/src/qdoc/qdoc/docbookgenerator.h +++ b/src/qdoc/qdoc/docbookgenerator.h @@ -162,6 +162,7 @@ private: QString m_buildVersion {}; QXmlStreamWriter *m_writer { nullptr }; bool m_useDocBook52 { false }; // Enable tags from DocBook 5.2. Also called "extensions". + bool m_useITS { false }; // Enable ITS attributes for parts that should not be translated. Config *m_config { nullptr }; }; diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/cpptypes.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/cpptypes.xml index 9dcabf364..b05c07240 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/cpptypes.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/cpptypes.xml @@ -1,5 +1,5 @@ - + Test C++ Types TestCPP diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml index cbdeb19b1..76635ac14 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoc-test-qmlmodule.xml @@ -1,7 +1,7 @@ - + -QDoc.Test QML Module +QDoc.Test QML Module Test A test project for QDoc build artifacts diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-exhaustive.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-exhaustive.xml index 878fb3211..95937d103 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-exhaustive.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-exhaustive.xml @@ -1,5 +1,5 @@ - + Exhaustive testing of QDoc commands OutputFromQDocFiles @@ -17,11 +17,11 @@ This is a section3 This is a section4 -This is bad code +This is bad code This text should have a line break riiiiight noooow. All your text belong to bold ...And this is an examble of only bold being, well, bold. - ... + ... This a caption Lorem legal ipsum diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-linking.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-linking.xml index 51b7e62b3..526279c9a 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-linking.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput-linking.xml @@ -1,5 +1,5 @@ - + Testing QDoc's link command OutputFromQDocFiles diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput.xml index 72905681d..a4a1d7c48 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocfileoutput.xml @@ -1,5 +1,5 @@ - + Testing QDoc output from .qdoc files OutputFromQDocFiles diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocmanuallikefileoutput.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocmanuallikefileoutput.xml index 8372f150c..5281cb7cd 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocmanuallikefileoutput.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qdoctests-qdocmanuallikefileoutput.xml @@ -1,5 +1,5 @@ - + Document Navigation OutputFromQDocFiles @@ -39,7 +39,7 @@ ]]> -<head> +<head> ... <link rel="start" href="basicqt.html" /> ... diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-int.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-int.xml index c7ce09e55..f5e99f6ab 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-int.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-int.xml @@ -1,7 +1,7 @@ - + -int QML Value Type +int QML Value Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in Qt 1.1. - + Import Statement diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml index 1691fbadf..b1f0eb9c7 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-abstractparent.xml @@ -1,7 +1,7 @@ - + -AbstractParent QML Type +AbstractParent QML Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in Qt 1.1. - + Import Statement @@ -47,7 +47,7 @@ Method Documentation void name(Child child, name) -Name a child using name. +Name a child using name. void name() @@ -55,7 +55,7 @@ void rear(Child child, var method = Strict) -Do some abstract parenting on child using a specific method. +Do some abstract parenting on child using a specific method. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml index e3a347678..82b98d215 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-child.xml @@ -1,7 +1,7 @@ - + -Child QML Type +Child QML Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in Qt 1.1. - + Import Statement @@ -47,7 +47,7 @@ Method Documentation void name(Child child, name) -Name a child of this child using name. +Name a child of this child using name. void name() @@ -55,7 +55,7 @@ void rear(Child child, var method = Strict) -Do some abstract parenting on child using a specific method. +Do some abstract parenting on child using a specific method. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml index 5091e0e27..eb6a36f65 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-doctest.xml @@ -1,7 +1,7 @@ - + -DocTest QML Type +DocTest QML Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in QDoc.Test 0.9. - + Import Statement @@ -47,7 +47,7 @@ [required] name : string Name of the test. -DocTest { +DocTest { name: "test" // ... } @@ -64,14 +64,14 @@ foo(var bar) -Signal with parameter bar. +Signal with parameter bar. The corresponding handler is onFoo. itsHappening(bool really) -Signals that something is really happening. +Signals that something is really happening. The corresponding handler is onItsHappening. @@ -81,7 +81,7 @@ Method Documentation [since QDoc.Test 1.0] fail(message = "oops") -Fails the current test case, with the optional message. +Fails the current test case, with the optional message. This method was introduced in QDoc.Test 1.0. @@ -89,10 +89,10 @@ Fails the current test case, hard. -Prints out msg. +Prints out msg. -Accepts a random option. +Accepts a random option. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml index ce2999582..5b0754cb0 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-oldtype.xml @@ -1,7 +1,7 @@ - + -OldType QML Type +OldType QML Type Test A test project for QDoc build artifacts @@ -10,7 +10,7 @@ This type was introduced in Qt 1.1. - + Import Statement 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 4f846dfac..e94650c2d 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 @@ -1,7 +1,7 @@ - + -Type QML Type +Type QML Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in Qt 1.1. - + Import Statement @@ -73,7 +73,7 @@ -Type.NoType +Type.NoType Nothing @@ -81,7 +81,7 @@ -Type.SomeType +Type.SomeType Something @@ -94,7 +94,7 @@ Signal Documentation completed(int status) -This signal is emitted when the operation completed with status. +This signal is emitted when the operation completed with status. The corresponding handler is onCompleted. @@ -125,7 +125,7 @@ Type copy(a) -Returns another Type based on a. +Returns another Type based on a. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml index 492e1b64e..92a9b6d6f 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-qdoc-test-yetanotherchild.xml @@ -1,7 +1,7 @@ - + -YetAnotherChild QML Type +YetAnotherChild QML Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in Qt 1.1. - + Import Statement diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml index 87576add4..4e96ad30d 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-test-nover-typenoversion.xml @@ -1,7 +1,7 @@ - + -TypeNoVersion QML Type +TypeNoVersion QML Type Test A test project for QDoc build artifacts @@ -9,7 +9,7 @@ This type was introduced in Qt 1.1. - + Import Statement diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-progressbar.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-progressbar.xml index ac48b6471..67ef7eeb4 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-progressbar.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-progressbar.xml @@ -1,14 +1,14 @@ - + -ProgressBar QML Type +ProgressBar QML Type Test A test project for QDoc build artifacts A component that shows the progress of an event. - + Import Statement diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-switch.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-switch.xml index 6c9d4a0f6..9eea38071 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-switch.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-switch.xml @@ -1,14 +1,14 @@ - + -Switch QML Type +Switch QML Type Test A test project for QDoc build artifacts A component that can be turned on or off. - + Import Statement diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-tabwidget.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-tabwidget.xml index e051ba196..5d81ac092 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-tabwidget.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/qml-uicomponents-tabwidget.xml @@ -1,14 +1,14 @@ - + -TabWidget QML Type +TabWidget QML Type Test A test project for QDoc build artifacts A widget that places its children as tabs. - + Import Statement @@ -24,7 +24,7 @@ Adding Tabs To add a tab, declare the tab as a child of the TabWidget. -TabWidget { +TabWidget { id: tabwidget Rectangle { @@ -52,7 +52,7 @@ [read-only] sampleReadOnlyProperty : int A sample read-only property. A contrived property to demonstrate QDoc's ability to detect read-only properties. The signature is: -readonly property int sampleReadOnlyProperty: 0 +readonly property int sampleReadOnlyProperty: 0 Note that the property must be initialized to a value. 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 add2bcae1..a5ffd1cd0 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 @@ -1,5 +1,5 @@ - + QML Documentation Example Test @@ -21,7 +21,7 @@ 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. -\qmlproperty int anAliasedProperty +\qmlproperty int anAliasedProperty An aliased property of type int. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-nover-qmlmodule.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-nover-qmlmodule.xml index 1cd079200..40af63eeb 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-nover-qmlmodule.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/test-nover-qmlmodule.xml @@ -1,7 +1,7 @@ - + -Versionless QML Module +Versionless QML Module Test A test project for QDoc build artifacts diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testcpp-module.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testcpp-module.xml index 0026854b2..993435fd6 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testcpp-module.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testcpp-module.xml @@ -1,7 +1,7 @@ - + -QDoc Test C++ Classes +QDoc Test C++ Classes TestCPP TestCPP Reference 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 12b574d2a..61657e1bd 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-test.xml @@ -1,8 +1,8 @@ - + -Test Class -TestQDoc::Test +Test Class +TestQDoc::Test TestCPP TestCPP Reference Documentation @@ -10,7 +10,7 @@ This class was introduced in Qt 2.0. - + Header @@ -56,31 +56,31 @@ Member Type Documentation -Test::SomeType +Test::SomeType A typedef. Member Function Documentation -[protected] void Test::overload() -[protected, since Test 1.2] void Test::overload(bool b) -Overloads that share a documentation comment, optionally taking a parameter b. +[protected] void Test::overload() +[protected, since Test 1.2] void Test::overload(bool b) +Overloads that share a documentation comment, optionally taking a parameter b. -[noexcept default] Test::Test() +[noexcept default] Test::Test() Default constructor. -void (*)(bool) Test::funcPtr(bool b, const char *s) -Returns a pointer to a function that takes a boolean. Uses b and s. +void (*)(bool) Test::funcPtr(bool b, const char *s) +Returns a pointer to a function that takes a boolean. Uses b and s. -void Test::inlineFunction() +void Test::inlineFunction() An inline function, documented using the \fn QDoc command. -void Test::methodWithEmDashInItsDocs() +void Test::methodWithEmDashInItsDocs() This method has em dashes in its documentation—as you'll find represented by --- in the sources—here and there. The important bit to note is that when passed e.g. to the \c command, the three hyphens are processed as input to the command and not replaced by an em dash. ----------------------------------------------------------------------- People can still add a bunch of dashes, though, without QDoc replacing them all with a series of em dashes. @@ -95,9 +95,9 @@ -void Test::methodWithEnDashInItsDocs() +void Test::methodWithEnDashInItsDocs() This method has en dashes in its documentation – as you'll find represented by -- in the sources – here and there. The important bit to note is that when passed e.g. to the \c command, the two hyphens are processed as input to the command and not replaced by an en dash. This also applies to code blocks, where otherwise, the decrement operator would get completely borked: -for (int i = 42; i > 0; --i) +for (int i = 42; i > 0; --i) // Do something cool during countdown. ...as it would be silly if this would output –i instead of --i. @@ -114,34 +114,34 @@ -int Test::someFunction(int, int v = 0) -Function that takes a parameter v. Also returns the value of v. +int Test::someFunction(int, int v = 0) +Function that takes a parameter v. Also returns the value of v. -void Test::someFunctionDefaultArg(int i, bool b = false) -Function that takes a parameter i and b. +void Test::someFunctionDefaultArg(int i, bool b = false) +Function that takes a parameter i and b. -[virtual] void Test::virtualFun() +[virtual] void Test::virtualFun() Function that must be reimplemented. -[noexcept default] TestQDoc::Test &Test::operator=(TestQDoc::Test &&other) -Move-assigns other. +[noexcept default] TestQDoc::Test &Test::operator=(TestQDoc::Test &&other) +Move-assigns other. Related Non-Members -bool operator==(const TestQDoc::Test &lhs, const TestQDoc::Test &rhs) -Returns true if lhs and rhs are equal. +bool operator==(const TestQDoc::Test &lhs, const TestQDoc::Test &rhs) +Returns true if lhs and rhs are equal. Macro Documentation -[since Test 1.1] QDOCTEST_MACRO2(int &x) -A macro with argument x. +[since Test 1.1] QDOCTEST_MACRO2(int &x) +A macro with argument x. This macro was introduced in Test 1.1. @@ -151,22 +151,22 @@ Obsolete Member Function Documentation -TestQDoc::Test &Test::operator++() -TestQDoc::Test &Test::operator--() +TestQDoc::Test &Test::operator++() +TestQDoc::Test &Test::operator--() This function is deprecated. We strongly advise against using it in new code. -void Test::anotherObsoleteMember() +void Test::anotherObsoleteMember() This function is deprecated. We strongly advise against using it in new code. Use obsoleteMember() instead. -void Test::deprecatedMember() +void Test::deprecatedMember() This function is deprecated since 6.0. We strongly advise against using it in new code. Use someFunction() instead. -void Test::obsoleteMember() +void Test::obsoleteMember() This function is deprecated. We strongly advise against using it in new code. Use someFunction() instead. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml index e28f7f70d..d7c1bc55c 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc-testderived.xml @@ -1,8 +1,8 @@ - + -TestDerived Class -TestQDoc::TestDerived +TestDerived Class +TestQDoc::TestDerived TestCPP TestCPP Reference Documentation @@ -10,7 +10,7 @@ This class was introduced in Qt 2.0. - + Header @@ -49,18 +49,18 @@ Member Type Documentation -[alias] TestDerived::DerivedType +[alias] TestDerived::DerivedType An aliased typedef. -[alias] TestDerived::NotTypedef +[alias] TestDerived::NotTypedef I'm an alias, not a typedef. Member Function Documentation -[override virtual] void TestDerived::virtualFun() +[override virtual] void TestDerived::virtualFun() Reimplements: Test::virtualFun(). @@ -70,7 +70,7 @@ Obsolete Member Function Documentation -[static] void TestDerived::staticObsoleteMember() +[static] void TestDerived::staticObsoleteMember() This function is deprecated. We strongly advise against using it in new code. Static obsolete method. diff --git a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc.xml b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc.xml index a00553748..5dbe4d677 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/testqdoc.xml @@ -1,7 +1,7 @@ - + -TestQDoc Namespace +TestQDoc Namespace TestCPP TestCPP Reference Documentation @@ -9,7 +9,7 @@ This namespace was introduced in Qt 2.0. - + Header @@ -57,7 +57,7 @@ Macro Documentation -QDOCTEST_MACRO +QDOCTEST_MACRO 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 f00b3d3f7..80e5b0cdc 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/docbook/uicomponents-qmlmodule.xml +++ b/tests/auto/qdoc/generatedoutput/expected_output/docbook/uicomponents-qmlmodule.xml @@ -1,7 +1,7 @@ - + -UI Components +UI Components Test A test project for QDoc build artifacts diff --git a/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf b/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf index 9bd6c7bba..b22b190fe 100644 --- a/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf +++ b/tests/auto/qdoc/generatedoutput/testdata/configs/docbook.qdocconf @@ -1,6 +1,7 @@ outputformats = DocBook DocBook.nosubdirs = true DocBook.outputsubdir = docbook +DocBook.its = true # TODO: DocBook generator has trouble handling shared comment nodes # allow two warnings related to these -- cgit v1.2.1