summaryrefslogtreecommitdiff
path: root/src/qdoc/qdocindexfiles.h
Commit message (Collapse)AuthorAgeFilesLines
* QDoc: Move QDoc source files under a further "qdoc" directoryLuca Di Sera2023-04-121-72/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc development under the "qttools" repository is currently performed under the "src/qdoc" directory, which contains all source files and directories relevant to QDoc as direct children. Due to a slow restructuring of how QDoc works, what its dependencies are and certain possible architectural changes, the infrastructure that is expected to be required for the development of QDoc might increase. Some of that infrastructure, which might require some custom effort, is expected to be developed as "independent" "library-like" sub-projects, which QDoc depends on. Albeit developed "independently", such infrastructure would be developed specifically for QDoc and thus should live "adjacent" to it. To allow such a structure a new "qdoc" directory was added under the "src/qdoc" directory. All source files and directory that were previously children of the "src/qdoc" directory were moved under the new "qdoc" directory. This preserves the space for QDoc-related elements and the relative project structure while allowing some space for "adjacent" projects that are intended for QDoc specifically. To support the change, a new "CMakeLists.txt" file was introduced under "src/qdoc", which dispatches to the "CMakeLists.txt" file in the new "src/qdoc/qdoc" directory. QDoc is only built when certain dependencies are found. This is supported through the use of Qt features at the CMake level. The "CMakeLists.txt" file in "src", thus dispatched to the "src/qdoc" directory only when the required features were found. As "independent", "library-like", entities might not have the same requirements as QDoc, the "CMakeLists.txt" file in "src" was modified to always dispatch to the "src/qdoc" directory while the features-check was moved to the new "CMakeLists.txt" files in "src/qdoc", so as to allow non-QDoc but QDoc-specific project to have an independent configuration for building. Certain test projects in "test/auto/qdoc/" depends on QDoc-specific source-files to generate their CMake targets. Those dependencies were generally specified as relative paths. The additional level in the directory structure invalidated the paths and, hence, the relevant "CMakeLists.txt" files for those projects were modified to correctly refer to the new directory structure. Change-Id: I50c7106614428753544eaba5091e1e44d48fd31d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Extract method from QDocIndexFiles::generateFunctionSectionPaul Wicking2023-04-041-0/+1
| | | | | | | | | QDocIndexFiles::generateFunctionSection has a lot going on. Use extract method as a step to clean up the method and introduce a level of abstraction to parts of its internals. Change-Id: If2efbfb10fcd8585c9c2298b2557ac880052a7ac Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: prefer std::pair over QPairPaul Wicking2022-08-091-1/+1
| | | | | | | | | | | Following the replacement in DocBookGenerator, replace the use of QPair with std::pair across QDoc's code base for consistency. Pick-to: 6.4 Change-Id: I2fc9f5f730a1bc570133b07d9eabad56d27ed9e8 Reviewed-by: Luca Di Sera <luca.disera@qt.io> Reviewed-by: Thibaut Cuvelier <cuvelier.thibaut@gmail.com>
* Use SPDX license identifiersLucie Gérard2022-05-191-27/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I5335388c0472b0ee554234fc7eca60769e504660 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QDoc: Code cleanupPaul Wicking2021-05-191-8/+8
| | | | | | | | | | | | | * Unify members; use s_ or m_ prefix instead of _ suffix. * Remove unnecessary member that duplicates content in base class. * Add [[nodiscard]] annotations where applicable. * Add overloads to virtual methods that have been extended with parameters with default values. * Make single argument ctors explicit. * Remove semi-colon from namespace declaration. Change-Id: Ie1ff39079722b81ba6754f945a898dc9b335bbae Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Code cleanupPaul Wicking2021-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use multiple arguments for QStrings instead of calling .arg() multiple times. * Define trivial constructor/destructor '= default' instead of adding empty implementations. * Remove unreachable code. * Prefer ranged-based for loops. * Initialize with auto from static_cast<>() and new. * Simplify expressions. * Prefer "QList::empty()" over "QList::size() > 0". * Remove unused method. * Return qsizetype instead of int to avoid narrowing conversion. * Remove unused include. * Remove unreachable return statement. * Prefer raw string literals over escaped regexes. * Initialize struct members. * Make variables used as const refs const refs. * Use std::move instead of passing const ref in ctor. * Drop redundant 'virtual' from methods marked 'override'. * Make local copies that arent ever modified const refs to avoid copying. * Turn for-loop into std::any_of. * Made single-argument constructor explicit. * Don't shadow variable names from outer scope if not necessary. * Remove const at top level that does not improve const correctness. * Update copyright notice for affected classes. Task-number: QTBUG-71176 Change-Id: Ia41e5b947b72f594b60d189b6b0ff68587c3afb9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Fix processing of related non-members read from indexTopi Reinio2020-10-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | QDoc writes a node using \relates twice into the index; once under the original (lexical) parent (typically, the global scope), and again under the adoptive parent specified with \relates. This is by design, as it allows searching for the node under both scopes. However, when the nodes are read back in, what was originally a single node was duplicated. This caused issues e.g. when that node is part of a group; when generating a list for a group, a line representing the node appeared twice. Use Aggregate::adoptChild() when reading nodes from index, instead of constructing multiple nodes. This is similar to what the code parser does when processing the \relates command. To identify an index entry appearing twice as a representation of a single node, repurpose the "related" attribute to track the index of each related node. Fixes: QTBUG-87311 Change-Id: I2aa8a97b9be26ee3945b3e4ce222b0f8dc4ca8b5 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix build errors due to forward declarations of QStringListFriedemann Kleint2020-09-151-1/+0
| | | | | | | | Remove forward declarations of QStringList, adapting to qtbase/652bd1efca34b7e114836f79c33b5e4a248faaee. Change-Id: I486106ee749aaa906c19e993c429c1fa0514663f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDoc: Use QList instead of QVectorJarek Kobus2020-06-091-1/+1
| | | | | | | | Task-number: QTBUG-84469 Change-Id: I88b99ba7f5648d9da7878b7f7723f48cd86be2ac Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Extract FunctionNode from NodePaul Wicking2020-06-041-0/+1
| | | | | | Task-number: QTBUG-84578 Change-Id: I5967054a1c802ac6daf2622dcd4e4c8c4b3977ac Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Introduce locationinfo configuration variableTopi Reinio2020-01-131-0/+1
| | | | | | | | | | | | | | | | | | This simple boolean variable determines whether the full path information of entities is stored into index files, and by extension, the output of the WebXML generator. The default value is true, and QDoc's output is unchanged. Using a value of false is useful for testing QDoc; we can omit system build paths in the output as those complicated the comparison of expected and generated data. [ChangeLog][qdoc] Introduced a configuration variable to drop host-specific paths from the generated output. Fixes: QTBUG-81091 Change-Id: Ic8df5e4a52a12821e2858a185c4e658905deb847 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* clang-format QDocPaul Wicking2019-12-171-7/+11
| | | | | | | | | | | | | | | | This patch is the result of formatting all of QDoc's source with clang-format. The clang-format style is from the qt5 super repo's _clang-format definition. The purpose is unify the style across the code, to avoid spending too much time on style related issues in reviews and cleanup patches. Future changes to QDoc can benefit from using git-clang-format in combination with the git commit hook provided in qtrepotools.git as mentioned in this email to the dev list: https://lists.qt-project.org/pipermail/development/2019-October/037682.html Change-Id: I8af6a051c8334b5f35862a4dcd3becce8ac500c2 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Change spaces to follow coding rulesThibaut Cuvelier2019-11-131-2/+2
| | | | | Change-Id: I81de861e9daa00249c47ddbe259f43f47d7c6615 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Clean up whitespacePaul Wicking2019-08-081-6/+6
| | | | | | | | | | | Ensure that QDoc conforms to Qt style, whitespace edition. For the most part, the change involves moving the pointer operators. Also remove whitespace following an opening parenthesis, or immediately preceding a closing one. In some cases, adjust the following line accordingly in methods that span multiple lines. Change-Id: I56ae125a2acf09c669c0a73dc814d05f13575f39 Reviewed-by: Martin Smith <martin.smith@qt.io>
* QDoc: Ensure all includes are uniform and according to stylePaul Wicking2019-08-031-1/+2
| | | | | | | | | | | | | | | | | | | Housekeeping. Includes are organized after recommended best practice and organized in the following order: - include self (i.e. include own header) - include local files - include Qt, e.g. <QtCore/qstring.h> - include Qt private - include externals, e.g. stdio.h in alphabetic order within each block, aside from accommodating #if-ery, in which includes follow the block they belong to. Also, updated copyright notice to year of latest edit in each file. Change-Id: I1e6b215f172fd5373d57016f7678b88b9e73231e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qdoc: Fix regressions in WebXML outputTopi Reinio2019-03-151-4/+12
| | | | | | | | | | | | | | | An update to qdoc that refactored the index file output was not reflected in the webxmlgenerator. This commit implements a callback interface between QDocIndexFiles and WebXMLGenerator to enable the latter to append documentation to generated elements. This also eliminates virtually all duplicated logic between the two classes. Fixes: QTBUG-74424 Change-Id: Ia302bbfd290c8d74591cb4804458d5b73c301378 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* qdoc: Major clean-up of FunctionNode and parameter processingv5.13.0-alpha1Martin Smith2019-02-061-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update was motivated by the need to correct two known issues in qdoc. First, linking to overloaded functions failed in some cases because the overloads were not numbered consistently, causing links to go to the wrong overload or to nowhere at all. Second, the mechanism for handling the \relates command didn't support using it to relate a function to more than one class. For example, there are many global qHash() functions spread around QtBase. Each is meant to compute a hash index for an object of some class type, so the object can be inserted into a QHash map for that class type. It is then desired to relate qHash(type Xxx, int seed) to both QHash<type> and class Xxx, so that the documentation for that qHash() function appears as a related non-member function of both QHash<type> and class Xxx. The example above also illustrates the overload numbering problem, because all these qHash() functions are overloads of the name qHash. To make matters worse, they are not all in the same module. Most of them are in QtCore, but a few are in QtNetwork, and this distribution problem will become worse over time as more qHash() functions are added. Prior to this update, qdoc was unable to relate a function to something in a different module, or it didn't always work. While designing a fix for these issues, it became clear that the processing of the FunctionNode and the function parameters would have to be rewritten. That's what this update does. These are the main points: 1. A new subclass of Node is added to act as a proxy for a class in another module. This ProxyNode acts as a place holder for the functions (and possibly other elements) that are related to a class in another module. This is used for the qHash() functions in QtNetwork that are related to QHash in QtCore. qdoc generates an html file named qtnetwork/qhash-proxy.html that contains the documentation for these functions. But these functions are listed as related non-members on the QHash class reference page in the qtcore output directory. They are listed there in the summary, but they link to the qhash-proxy.html page in qtnetwork. 2. A new, Parameters class is added to qdoc (parameters.h and parameters.cpp), and the class Parameter is moved there from node.h. class Parameters replaces the old QVector<Parameter> wherever it was used. This encapsulates all the parameter processing and matching in the Parameters class and simplifies the code at all the places where QVector<Parameter> had been used. 3. The assignment of overload numbers is now done in the normalizeOverloads() function, which is called after all the headers and sources have been processed but before the generate phase begins. This assignment is a simple renumbering now because all the overloads of a function are linked to each other via a nextOverload_ link in the FunctionNode. The first function named qHash() is inserted into the Aggregate node's function map, but subsequent qHash() FunctionNodes are not entered into the function map but are linked to the first qHash() via its nextOverload_ link. 4. The \relates command can now be used multiple times in a single qdoc comment. There remains some work to be done here because this currently only works for global entities, but there are several cases where \relates has been used in the qdoc comment of a member of a class. This will be fixed soon, I believe. When qdoc sees the first \relates Xxx command, for example for qHash(Yyy, seed), that qHash() is a child of the global namespace. qdoc allows it to remain as a child of the global namespace but it tells class Xxx to "adopt" that child (see Node::adoptChild()). This function makes this instance of qHash() be a child of class Xxx (in this case QHash<type>), so that the parent of this qHash() becomes Xxx. After this "adoption," qHash() is a child of both the global namespace and class Xxx, but qHash() only knows it is a child of Xxx, i.e. its parent pointer is Xxx. If this is the first qHash() to become a child of Xxx, it is inserted into the function map of Xxx, but its nextOverload_ link is not changed. This is because all the global qHash() functions have already been linked into the nextOverload_ linked list, and this list must not be changed. Hence, when qdoc searches for qHash(something) to make a link to it, it will find it as a child of the global namespace, but it will correctly link to it using its actual parent pointer. When qdoc sees the second \relates Yyy for this qHash() function, qdoc sees that this FunctionNode has already been made a related non-member of Xxx, so it can't let Yyy "adopt" it. Instead, it tells Yyy to clone this qHash(), which creates a shallow copy of it but resets its nextOverload_ pointer to nullptr. I believe this clone of qHash() won't be found in a search for a function named qHash(), because the global one (the adopted one) will be found first. Or, if it is found, a link to the clone will be generated, but that's ok because the documentation is identical. Note that the existence of qHash in two child lists is taken into account at destruction time. The only place where a Node is destroyed is in the destructor of Tree, which destroys the Node tree from the root down to the leaves. Each aggregate node is responsible for deleting each of its child nodes, but it only deletes a child node if it is the parent of that child node. All of the above revealed that some of the findFunctionNode() functions were either no longer needed or weren't being called in the first place, so they were deleted. This change is now ready for testing. Change-Id: I6da3e2e9e71d39a29d90e073ed614309a49e3d4c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* qdoc: Revive the WebXML generatorTopi Reinio2017-10-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Reintroduce the WebXML generator that was last seen in Qt 4.7 - this generator produces XML output similar to .index files, with embedded documentation content. To be used for generating documentation for the PySide project. Uses code from QDocIndexFiles to generate the elements. The generator itself is a specialization of the HTML generator as a lot of the code common to all generators is implemented in the HTML generator and not the base class. This could be cleaned up later on. To use the generator, set the 'outputformats' .qdocconf variable: outputformats = WebXML In addition for PySide/Shiboken, \snippet commands must be configured to generate <snippet> elements instead of hardcoded <code> snippets: quotinginformation = true Task-number: PYSIDE-363 Change-Id: I6b0770c5cd0db3e374f63f9c437fa9e8a77d3f8d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Updated license headers and license testsAntti Kokko2016-06-101-17/+12
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are licensed under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) License header tests also updated to match current headers. Change-Id: Ia6bdacaa3c5bbc9d31334e1a0cabfe502a484dc4 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* move qdoc back to qttoolsOswald Buddenhagen2015-10-231-0/+86
we can do that now, as the bootstrap lib is now a properly exported module, and qmldevtools is now bootstrapped as well. this removes the abomination of a copy of the qml parser in qtbase. unfortunately qtbase/2422251ee5025a067b14b989153764ab36e43f10 is reverted, as qtdeclarative is still missing the respective change. this introduces no regression in discoverability or usability, as a full doc build already needed qttools - for qhelpgenerator. Change-Id: Ic9c4c9732ddf5998637b9e42e27939ba50b31479 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>