diff options
18 files changed, 111 insertions, 85 deletions
diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp index 6667c6688..04c39281b 100644 --- a/src/qdoc/config.cpp +++ b/src/qdoc/config.cpp @@ -83,6 +83,7 @@ QString ConfigStrings::INDEXES = QStringLiteral("indexes"); QString ConfigStrings::LANDINGPAGE = QStringLiteral("landingpage"); QString ConfigStrings::LANDINGTITLE = QStringLiteral("landingtitle"); QString ConfigStrings::LANGUAGE = QStringLiteral("language"); +QString ConfigStrings::LOCATIONINFO = QStringLiteral("locationinfo"); QString ConfigStrings::MACRO = QStringLiteral("macro"); QString ConfigStrings::MANIFESTMETA = QStringLiteral("manifestmeta"); QString ConfigStrings::MODULEHEADER = QStringLiteral("moduleheader"); @@ -294,6 +295,7 @@ void Config::reset() setStringList(CONFIG_LANGUAGE, QStringList("Cpp")); // i.e. C++ setStringList(CONFIG_OUTPUTFORMATS, QStringList("HTML")); setStringList(CONFIG_TABSIZE, QStringList("8")); + setStringList(CONFIG_LOCATIONINFO, QStringList("true")); // Publish options from the command line as config variables const auto setListFlag = [this](const QString &key, bool test) { diff --git a/src/qdoc/config.h b/src/qdoc/config.h index e241e8d75..36023b38a 100644 --- a/src/qdoc/config.h +++ b/src/qdoc/config.h @@ -240,6 +240,7 @@ struct ConfigStrings static QString LANDINGPAGE; static QString LANDINGTITLE; static QString LANGUAGE; + static QString LOCATIONINFO; static QString MACRO; static QString MANIFESTMETA; static QString MODULEHEADER; @@ -323,6 +324,7 @@ struct ConfigStrings #define CONFIG_LANDINGPAGE ConfigStrings::LANDINGPAGE #define CONFIG_LANDINGTITLE ConfigStrings::LANDINGTITLE #define CONFIG_LANGUAGE ConfigStrings::LANGUAGE +#define CONFIG_LOCATIONINFO ConfigStrings::LOCATIONINFO #define CONFIG_MACRO ConfigStrings::MACRO #define CONFIG_MANIFESTMETA ConfigStrings::MANIFESTMETA #define CONFIG_MODULEHEADER ConfigStrings::MODULEHEADER diff --git a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc index ca3721d8f..b2b4c8499 100644 --- a/src/qdoc/doc/qdoc-manual-qdocconf.qdoc +++ b/src/qdoc/doc/qdoc-manual-qdocconf.qdoc @@ -111,6 +111,7 @@ \li \l {images-variable} {images} \li \l {images.fileextensions-variable} {images.fileextensions} \li \l {language-variable} {language} + \li \l {locationinfo-variable} {locationinfo} \li \l {macro-variable} {macro} \li \l {manifestmeta-variable} {manifestmeta} \li \l {navigation-variable} {navigation} @@ -789,6 +790,28 @@ This identifies C++ as the language of the Qt source code. + \target locationinfo-variable + \section1 locationinfo + + The \c locationinfo boolean variable determines whether detailed + location information about each entity is written to + \c {.index}-files and \c {.webxml]-files (when using the WebXML + output format). + + Location information consists of the full path and line + number of either the declaration or documentation comment block + in the source code. + + Setting this to \c false turns off location info: + + \badcode + locationinfo = false + \endcode + + The default value is \c true. + + The \c locationinfo variable was introduced in QDoc 5.15. + \target macro-variable \section1 macro diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index 7298f7e84..fafeb006c 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -69,6 +69,7 @@ QDocIndexFiles *QDocIndexFiles::qdocIndexFiles_ = nullptr; QDocIndexFiles::QDocIndexFiles() : gen_(nullptr) { qdb_ = QDocDatabase::qdocDB(); + storeLocationInfo_ = Config::instance().getBool(CONFIG_LOCATIONINFO); } /*! @@ -930,7 +931,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter &writer, Node *node, const Location &declLocation = node->declLocation(); if (!declLocation.fileName().isEmpty()) writer.writeAttribute("location", declLocation.fileName()); - if (!declLocation.filePath().isEmpty()) { + if (storeLocationInfo_ && !declLocation.filePath().isEmpty()) { writer.writeAttribute("filepath", declLocation.filePath()); writer.writeAttribute("lineno", QString("%1").arg(declLocation.lineNo())); } @@ -1321,7 +1322,7 @@ void QDocIndexFiles::generateFunctionSection(QXmlStreamWriter &writer, FunctionN const Location &declLocation = fn->declLocation(); if (!declLocation.fileName().isEmpty()) writer.writeAttribute("location", declLocation.fileName()); - if (!declLocation.filePath().isEmpty()) { + if (storeLocationInfo_ && !declLocation.filePath().isEmpty()) { writer.writeAttribute("filepath", declLocation.filePath()); writer.writeAttribute("lineno", QString("%1").arg(declLocation.lineNo())); } diff --git a/src/qdoc/qdocindexfiles.h b/src/qdoc/qdocindexfiles.h index 96e73a9ed..b37c132a4 100644 --- a/src/qdoc/qdocindexfiles.h +++ b/src/qdoc/qdocindexfiles.h @@ -85,6 +85,7 @@ private: Generator *gen_; QString project_; QVector<QPair<ClassNode *, QString>> basesList_; + bool storeLocationInfo_; }; QT_END_NAMESPACE diff --git a/src/qdoc/webxmlgenerator.cpp b/src/qdoc/webxmlgenerator.cpp index d69e4d467..4d8906f6a 100644 --- a/src/qdoc/webxmlgenerator.cpp +++ b/src/qdoc/webxmlgenerator.cpp @@ -28,6 +28,7 @@ #include "webxmlgenerator.h" +#include "config.h" #include "helpprojectwriter.h" #include "node.h" #include "qdocdatabase.h" @@ -135,11 +136,14 @@ void WebXMLGenerator::generateExampleFilePage(const Node *en, const QString &fil writer.writeAttribute("fulltitle", title); writer.writeAttribute("subtitle", file); writer.writeStartElement("description"); - QString userFriendlyFilePath; // unused - writer.writeAttribute("path", - Doc::resolveFile(en->doc().location(), file, &userFriendlyFilePath)); - writer.writeAttribute("line", "0"); - writer.writeAttribute("column", "0"); + + if (Config::instance().getBool(CONFIG_LOCATIONINFO)) { + QString userFriendlyFilePath; // unused + writer.writeAttribute("path", + Doc::resolveFile(en->doc().location(), file, &userFriendlyFilePath)); + writer.writeAttribute("line", "0"); + writer.writeAttribute("column", "0"); + } Quoter quoter; Doc::quoteFromFile(en->doc().location(), quoter, file); @@ -171,9 +175,11 @@ void WebXMLGenerator::append(QXmlStreamWriter &writer, Node *node) Q_ASSERT(marker_); writer.writeStartElement("description"); - writer.writeAttribute("path", node->doc().location().filePath()); - writer.writeAttribute("line", QString::number(node->doc().location().lineNo())); - writer.writeAttribute("column", QString::number(node->doc().location().columnNo())); + if (Config::instance().getBool(CONFIG_LOCATIONINFO)) { + writer.writeAttribute("path", node->doc().location().filePath()); + writer.writeAttribute("line", QString::number(node->doc().location().lineNo())); + writer.writeAttribute("column", QString::number(node->doc().location().columnNo())); + } if (node->isTextPageNode()) generateRelations(writer, node); diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml index 1001d0c53..b3dc9dffa 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/first.webxml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <class name="First" href="first.html" status="active" access="public" location="bbb.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h" lineno="2" documented="true" module="TestModule"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="28" column="4"> + <class name="First" href="first.html" status="active" access="public" location="bbb.h" documented="true" module="TestModule"> + <description> <para>This is a first class</para> </description> - <class name="Nested" fullname="First::Nested" href="first-nested.html" status="active" access="private" location="bbb.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/bbb.h" lineno="4" documented="true" module="TestModule"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="35" column="4"> + <class name="Nested" fullname="First::Nested" href="first-nested.html" status="active" access="private" location="bbb.h" documented="true" module="TestModule"> + <description> <para>This is a nested class</para> </description> </class> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml index 4e51df8d0..c2235e69d 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/index.webxml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <page name="index.html" href="index.html" status="active" location="index.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc" lineno="1" documented="true" subtype="page" title="doc index" fulltitle="doc index" subtitle="" module="TestModule"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/qdoc/index.qdoc" line="1" column="5"> + <page name="index.html" href="index.html" status="active" location="index.qdoc" documented="true" subtype="page" title="doc index" fulltitle="doc index" subtitle="" module="TestModule"> + <description> <generatedlist contents="classesbymodule TestModule"/> </description> </page> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml index 9e203d926..eb519cd51 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput-linking.webxml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <page name="qdoctests-qdocfileoutput-linking.html" href="qdoctests-qdocfileoutput-linking.html" status="active" location="qdoctests-outputfromqdocfiles.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" lineno="71" documented="true" subtype="page" title="Testing QDoc's link command" fulltitle="Testing QDoc's link command" subtitle="" module="Test" brief="This is a page for testing QDoc's link command"> + <page name="qdoctests-qdocfileoutput-linking.html" href="qdoctests-qdocfileoutput-linking.html" status="active" location="qdoctests-outputfromqdocfiles.qdoc" documented="true" subtype="page" title="Testing QDoc's link command" fulltitle="Testing QDoc's link command" subtitle="" module="Test" brief="This is a page for testing QDoc's link command"> <target name="link-test-target"/> <keyword name="qdoc-linking-test" title="QDoc Linking Test"/> <contents name="link-targets" title="Link targets" level="1"/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" line="71" column="4"> + <description> <brief>This is a page for testing QDoc's link command.</brief> <target name="link-test-target"/> <section id="link-targets"> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml index c09bbe31c..94dee89e3 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/qdoctests-qdocfileoutput.webxml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <page name="qdoctests-qdocfileoutput.html" href="qdoctests-qdocfileoutput.html" status="active" location="qdoctests-outputfromqdocfiles.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" lineno="28" documented="true" subtype="page" title="Testing QDoc output from .qdoc files" fulltitle="Testing QDoc output from .qdoc files" subtitle="" module="Test" brief="This is a simple page for testing purposes only"> + <page name="qdoctests-qdocfileoutput.html" href="qdoctests-qdocfileoutput.html" status="active" location="qdoctests-outputfromqdocfiles.qdoc" documented="true" subtype="page" title="Testing QDoc output from .qdoc files" fulltitle="Testing QDoc output from .qdoc files" subtitle="" module="Test" brief="This is a simple page for testing purposes only"> <contents name="supported-file-types" title="Supported file types" level="1"/> <contents name="further-information" title="Further information" level="1"/> <contents name="linking" title="Linking" level="1"/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/qdoctests-outputfromqdocfiles.qdoc" line="28" column="4"> + <description> <brief>This is a simple page for testing purposes only.</brief> <para>QDoc generates documentation for software projects. It does this by extracting <italic>QDoc comments</italic> from project source files. QDoc comments are signified by a C-style-like comment tag followed by an exclamation point, like this: <teletype type="highlighted">/*!</teletype> <teletype type="highlighted">This text is contained within QDoc comment tags.</teletype> <teletype type="highlighted">*/</teletype>.</para> <section id="supported-file-types"> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml index 0a4939841..9ecd3c2fe 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/second.webxml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <class name="Second" href="second.html" status="active" access="public" location="ccc.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/ccc.h" lineno="2" documented="true" module="TestModule"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="42" column="4"> + <class name="Second" href="second.html" status="active" access="public" location="ccc.h" documented="true" module="TestModule"> + <description> <para>This is a second class</para> </description> </class> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml index 8689d2e76..377c49980 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/test-componentset-example.webxml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <page name="componentset" href="test-componentset-example.html" status="active" location="examples.qdoc" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/examples.qdoc" lineno="28" documented="true" subtype="example" title="QML Documentation Example" fulltitle="QML Documentation Example" subtitle="" module="Test"> + <page name="componentset" href="test-componentset-example.html" status="active" location="examples.qdoc" documented="true" subtype="example" title="QML Documentation Example" fulltitle="QML Documentation Example" subtitle="" module="Test"> <contents name="qml-class" title="QML Class" level="1"/> <contents name="properties-signals-handlers-and-methods" title="Properties, Signals, Handlers, and Methods" level="1"/> <contents name="internal-documentation" title="Internal Documentation" level="2"/> <contents name="qml-types-with-c-implementation" title="QML Types with C++ Implementation" level="1"/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/examples.qdoc" line="28" column="4"> + <description> <para>This example demonstrates one of the ways to document QML types.</para> <para>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 <link raw="UI Components" href="uicomponents-qmlmodule.html" type="">UI Components</link> module.</para> <para>The uicomponents.qdoc file generates the overview page for the <link raw="UI Components" href="uicomponents-qmlmodule.html" type="">UI Components</link> module page.</para> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml index 5d88b6e7c..d2726cc57 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-test.webxml @@ -1,58 +1,58 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <class name="Test" fullname="TestQDoc::Test" href="testqdoc-test.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="34" documented="true" module="TestCPP" brief="A class in a namespace"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="49" column="4"> + <class name="Test" fullname="TestQDoc::Test" href="testqdoc-test.html" status="active" access="public" location="testcpp.h" documented="true" module="TestCPP" brief="A class in a namespace"> + <description> <brief>A class in a namespace.</brief> </description> <function name="QDOCTEST_MACRO2" href="testqdoc-test.html#QDOCTEST_MACRO2" status="active" access="public" documented="true" related="true" since="Test 1.1" meta="macrowithparams" virtual="non" const="false" static="false" final="false" override="false" type="" brief="A macro with argument x" signature="QDOCTEST_MACRO2( x)"> <parameter type="" name="x" default=""/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="66" column="4"> + <description> <brief>A macro with argument <argument>x</argument>.</brief> </description> </function> - <function name="anotherObsoleteMember" fullname="TestQDoc::Test::anotherObsoleteMember" href="testqdoc-test-obsolete.html#anotherObsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="39" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void anotherObsoleteMember()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="93" column="4"> + <function name="anotherObsoleteMember" fullname="TestQDoc::Test::anotherObsoleteMember" href="testqdoc-test-obsolete.html#anotherObsoleteMember" status="obsolete" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void anotherObsoleteMember()"> + <description> <para>Use <link raw="obsoleteMember()" href="testqdoc-test-obsolete.html#obsoleteMember" type="function">obsoleteMember()</link> instead.</para> </description> </function> - <function name="deprecatedMember" fullname="TestQDoc::Test::deprecatedMember" href="testqdoc-test-obsolete.html#deprecatedMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="40" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void deprecatedMember()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="73" column="4"> + <function name="deprecatedMember" fullname="TestQDoc::Test::deprecatedMember" href="testqdoc-test-obsolete.html#deprecatedMember" status="obsolete" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void deprecatedMember()"> + <description> <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para> </description> </function> - <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="41" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="120" column="4"> + <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"> + <description> <brief>An inline function, documented using the \fn QDoc command.</brief> </description> </function> - <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="38" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="83" column="4"> + <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="obsolete" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"> + <description> <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para> </description> </function> - <function name="overload" fullname="TestQDoc::Test::overload" href="testqdoc-test.html#overload" status="active" access="protected" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="45" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void overload()"> - <description path="" line="0" column="0"/> + <function name="overload" fullname="TestQDoc::Test::overload" href="testqdoc-test.html#overload" status="active" access="protected" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void overload()"> + <description/> </function> - <function name="overload" fullname="TestQDoc::Test::overload" href="testqdoc-test.html#overload-1" status="active" access="protected" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="46" meta="plain" virtual="non" const="false" static="false" final="false" override="false" overload="true" overload-number="1" type="void" signature="void overload(bool b)"> + <function name="overload" fullname="TestQDoc::Test::overload" href="testqdoc-test.html#overload-1" status="active" access="protected" location="testcpp.h" meta="plain" virtual="non" const="false" static="false" final="false" override="false" overload="true" overload-number="1" type="void" signature="void overload(bool b)"> <parameter type="bool" name="b" default=""/> - <description path="" line="0" column="0"/> + <description/> </function> - <function name="someFunction" fullname="TestQDoc::Test::someFunction" href="testqdoc-test.html#someFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="36" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="int" signature="int someFunction(int v)"> + <function name="someFunction" fullname="TestQDoc::Test::someFunction" href="testqdoc-test.html#someFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="int" signature="int someFunction(int v)"> <parameter type="int" name="v" default=""/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="111" column="4"> + <description> <para>Function that takes a parameter <argument>v</argument>. Also returns the value of <argument>v</argument>.</para> </description> </function> - <function name="someFunctionDefaultArg" fullname="TestQDoc::Test::someFunctionDefaultArg" href="testqdoc-test.html#someFunctionDefaultArg" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="37" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void someFunctionDefaultArg(int i, bool b)"> + <function name="someFunctionDefaultArg" fullname="TestQDoc::Test::someFunctionDefaultArg" href="testqdoc-test.html#someFunctionDefaultArg" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void someFunctionDefaultArg(int i, bool b)"> <parameter type="int" name="i" default=""/> <parameter type="bool" name="b" default="false"/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="103" column="4"> + <description> <para>Function that takes a parameter <argument>i</argument> and <argument>b</argument>.</para> </description> </function> - <function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="42" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="126" column="4"> + <function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()"> + <description> <para>Function that must be reimplemented.</para> </description> </function> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml index c0c8d852f..76a335658 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc-testderived.webxml @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="49" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="55" column="4"> + <class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace"> + <description> <brief>A derived class in a namespace.</brief> </description> - <function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="51" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="134" column="4"/> + <function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override"> + <description/> </function> </class> </document> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml index 750f544b8..a8cbb951a 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/testqdoc.webxml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <namespace name="TestQDoc" href="testqdoc.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="32" documented="true" module="TestCPP" brief="A namespace"> + <namespace name="TestQDoc" href="testqdoc.html" status="active" access="public" location="testcpp.h" documented="true" module="TestCPP" brief="A namespace"> <contents name="usage" title="Usage" level="1"/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="39" column="4"> + <description> <brief>A namespace.</brief> <section id="usage"> <heading level="1">Usage</heading> @@ -11,63 +11,63 @@ </section> </description> <function name="QDOCTEST_MACRO" href="testqdoc.html#QDOCTEST_MACRO" status="active" access="public" documented="true" related="true" meta="macrowithoutparams" virtual="non" const="false" static="false" final="false" override="false" type="" signature="QDOCTEST_MACRO"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="61" column="4"/> + <description /> </function> - <class name="Test" fullname="TestQDoc::Test" href="testqdoc-test.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="34" documented="true" module="TestCPP" brief="A class in a namespace"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="49" column="4"> + <class name="Test" fullname="TestQDoc::Test" href="testqdoc-test.html" status="active" access="public" location="testcpp.h" documented="true" module="TestCPP" brief="A class in a namespace"> + <description> <brief>A class in a namespace.</brief> </description> <function name="QDOCTEST_MACRO2" href="testqdoc-test.html#QDOCTEST_MACRO2" status="active" access="public" documented="true" related="true" since="Test 1.1" meta="macrowithparams" virtual="non" const="false" static="false" final="false" override="false" type="" brief="A macro with argument x" signature="QDOCTEST_MACRO2( x)"> <parameter type="" name="x" default=""/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="66" column="4"> + <description> <brief>A macro with argument <argument>x</argument>.</brief> </description> </function> - <function name="anotherObsoleteMember" fullname="TestQDoc::Test::anotherObsoleteMember" href="testqdoc-test-obsolete.html#anotherObsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="39" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void anotherObsoleteMember()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="93" column="4"> + <function name="anotherObsoleteMember" fullname="TestQDoc::Test::anotherObsoleteMember" href="testqdoc-test-obsolete.html#anotherObsoleteMember" status="obsolete" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void anotherObsoleteMember()"> + <description> <para>Use <link raw="obsoleteMember()" href="testqdoc-test-obsolete.html#obsoleteMember" type="function">obsoleteMember()</link> instead.</para> </description> </function> - <function name="deprecatedMember" fullname="TestQDoc::Test::deprecatedMember" href="testqdoc-test-obsolete.html#deprecatedMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="40" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void deprecatedMember()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="73" column="4"> + <function name="deprecatedMember" fullname="TestQDoc::Test::deprecatedMember" href="testqdoc-test-obsolete.html#deprecatedMember" status="obsolete" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void deprecatedMember()"> + <description> <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para> </description> </function> - <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="41" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="120" column="4"> + <function name="inlineFunction" fullname="TestQDoc::Test::inlineFunction" href="testqdoc-test.html#inlineFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" brief="An inline function, documented using the \fn QDoc command" signature="void inlineFunction()"> + <description> <brief>An inline function, documented using the \fn QDoc command.</brief> </description> </function> - <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="obsolete" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="38" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="83" column="4"> + <function name="obsoleteMember" fullname="TestQDoc::Test::obsoleteMember" href="testqdoc-test-obsolete.html#obsoleteMember" status="obsolete" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void obsoleteMember()"> + <description> <para>Use <link raw="someFunction()" href="testqdoc-test.html#someFunction" type="function">someFunction()</link> instead.</para> </description> </function> - <function name="someFunction" fullname="TestQDoc::Test::someFunction" href="testqdoc-test.html#someFunction" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="36" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="int" signature="int someFunction(int v)"> + <function name="someFunction" fullname="TestQDoc::Test::someFunction" href="testqdoc-test.html#someFunction" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="int" signature="int someFunction(int v)"> <parameter type="int" name="v" default=""/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="111" column="4"> + <description> <para>Function that takes a parameter <argument>v</argument>. Also returns the value of <argument>v</argument>.</para> </description> </function> - <function name="someFunctionDefaultArg" fullname="TestQDoc::Test::someFunctionDefaultArg" href="testqdoc-test.html#someFunctionDefaultArg" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="37" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void someFunctionDefaultArg(int i, bool b)"> + <function name="someFunctionDefaultArg" fullname="TestQDoc::Test::someFunctionDefaultArg" href="testqdoc-test.html#someFunctionDefaultArg" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="non" const="false" static="false" final="false" override="false" type="void" signature="void someFunctionDefaultArg(int i, bool b)"> <parameter type="int" name="i" default=""/> <parameter type="bool" name="b" default="false"/> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="103" column="4"> + <description> <para>Function that takes a parameter <argument>i</argument> and <argument>b</argument>.</para> </description> </function> - <function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="42" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="126" column="4"> + <function name="virtualFun" fullname="TestQDoc::Test::virtualFun" href="testqdoc-test.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="false" type="void" signature="void virtualFun()"> + <description> <para>Function that must be reimplemented.</para> </description> </function> </class> - <class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="45" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="55" column="4"> + <class name="TestDerived" fullname="TestQDoc::TestDerived" href="testqdoc-testderived.html" status="active" access="public" location="testcpp.h" documented="true" bases="TestQDoc::Test" module="TestCPP" brief="A derived class in a namespace"> + <description> <brief>A derived class in a namespace.</brief> </description> - <function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.h" lineno="47" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/testcpp.cpp" line="134" column="4"/> + <function name="virtualFun" fullname="TestQDoc::TestDerived::virtualFun" href="testqdoc-testderived.html#virtualFun" status="active" access="public" location="testcpp.h" documented="true" meta="plain" virtual="virtual" const="false" static="false" final="false" override="true" type="void" signature="void virtualFun() override"> + <description /> </function> </class> </namespace> diff --git a/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml b/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml index d826bb421..529ffd896 100644 --- a/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml +++ b/tests/auto/qdoc/generatedoutput/expected_output/html/third.webxml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <WebXML> <document> - <class name="Third" href="third.html" status="active" access="public" location="aaa.h" filepath="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/inc/testmodule/aaa.h" lineno="2" documented="true" module="TestModule"> - <description path="/home/levon/work/official/qttools/tests/auto/qdoc/generatedoutput/bug80259/src/main.cpp" line="49" column="4"> + <class name="Third" href="third.html" status="active" access="public" location="aaa.h" documented="true" module="TestModule"> + <description> <para>This is a third class</para> </description> </class> diff --git a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp index 62052e453..01608e95f 100644 --- a/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp +++ b/tests/auto/qdoc/generatedoutput/tst_generatedoutput.cpp @@ -62,7 +62,6 @@ private: QScopedPointer<QTemporaryDir> m_outputDir; QString m_qdoc; - void removeFullPathStrings(QString &str); void runQDocProcess(const QStringList &arguments); void compareLineByLine(const QStringList &expectedFiles); void testAndCompare(const char *input, const char *outNames, const char *extraParams = nullptr, @@ -110,13 +109,6 @@ void tst_generatedOutput::runQDocProcess(const QStringList &arguments) QFAIL("Running QDoc failed. See output above."); } -void tst_generatedOutput::removeFullPathStrings(QString &str) -{ - QRegularExpression re("(location|path|filepath)=\"[^\"]+\""); - QRegularExpressionMatch match = re.match(str); - str.replace(re, match.captured(1) + "=\"REMOVED_BY_TEST\""); -} - void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles) { for (const auto &file : expectedFiles) { @@ -140,8 +132,6 @@ void tst_generatedOutput::compareLineByLine(const QStringList &expectedFiles) QString prefix = file + delim + QString::number(lineNumber) + delim; QString expectedLine = prefix + expectedIn.readLine(); QString actualLine = prefix + actualIn.readLine(); - removeFullPathStrings(actualLine); - removeFullPathStrings(expectedLine); QCOMPARE(actualLine, expectedLine); } } diff --git a/tests/auto/qdoc/generatedoutput/webxml.qdocconf b/tests/auto/qdoc/generatedoutput/webxml.qdocconf index d6e6290b8..903c7fcfe 100644 --- a/tests/auto/qdoc/generatedoutput/webxml.qdocconf +++ b/tests/auto/qdoc/generatedoutput/webxml.qdocconf @@ -1,3 +1,4 @@ +locationinfo = false outputformats = WebXML WebXML.quotinginformation = true WebXML.nosubdirs = true |