summaryrefslogtreecommitdiff
path: root/src/qdoc/generator.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | qdoc: Correct handling of functions declared in Q_OBJECTMartin Smith2018-01-121-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions were being eliminated from the documentation in the clang visitor, but this doesn't when the functions actually have documentation. This update moves the test for whether they should be documented or not to the Generator class. This update also avoids reporting a qdoc warning for a typedef defined in Q_GADGET. Change-Id: Icca7297ec2123c684203d225d2bda96e50dacd8c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | qdoc: Partial refactor of Node hierarchyMartin Smith2017-12-041-42/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ironically, The Node suclass CollectionNode should not be a subclass of Aggregate because CollectionNode never has children. It only has members, which are children of other Aggregate nodes. This update makes CollectionNode a subclass of LeafNode instead of Aggregate. This refactoring is necessary to implement the task QTBUG-45725. Change-Id: I60b2dcdaa3da1d138a0e6b4eb3d4f78cba0053d4 Task-number: QTBUG-45725 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-201-10/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | Conflicts: src/qdoc/qdocdatabase.h Change-Id: I044c17d6a953c9689a4d928972d3fd757e468114
| * | qdoc/generator: demonstrate QOverload instead of complex syntax...v5.10.0-beta1Gatis Paeglis2017-09-251-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | ...for connecting to overloaded signals. Change-Id: I30ad6c371f01212dba8a6f9a905c766a961b32a1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | qdoc: Document C++ functions that are invokableMartin Smith2017-11-161-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update lets clang report to qdoc whenever Q_INVOKABLE appears in a C++ function declaration so that qdoc can add a note to the function's documentation telling the reader that the function is invokable via the meta-object system and from QML. Task-number: QTBUG-59083 Change-Id: I9b62ba1c9159a1ec43c6a59e576efdb71bff62e5 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | Merge remote-tracking branch 'origin/wip/qdoc-clang' into devLiang Qi2017-11-131-12/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qdoc/cppcodeparser.h src/qdoc/location.cpp src/qdoc/qmlcodeparser.h Change-Id: I2e579ca5d83cd1c4b42acc9a07066d800cbc02cb
| * | | qdoc: This ends use of qdoc's old C++ parserMartin Smith2017-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces the last uses of qdoc's old, ad hoc C++ parser. Clang is now used for parsing all C++ code. \macro, \qmlxxx, and \jsxxx commands are parsed by simple pattern matching functions using QString::split(). Change-Id: If6f95b0487d1dd3206373bc55ec8e6b8b9c55b1e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | qdoc: Better support for multi-\fn documentation blocksMartin Smith2017-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is a partial fix for the multi-\fn documentation concept. It outputs the documentation once but listing all the function signatures from the \fn commands found in the qdoc comment. Multiple \since commands are not implemented; the \until command is not implemented, and providing text applicable to a specific \fn signature is not implemented. This change requires clang, which means it requires a sequence of other updates as well, so you can't test it unless you have all that stuff. Task-number: QTBUG-60420 Change-Id: Ib316b6f97fa427ef730c4badfc785101bff55dce Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * | | qdoc: Don't report missing parameter nameMartin Smith2017-08-101-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See QTBUG-58277. No longer report missing parameter names when processing the \fn command, because there are cases where they are not required. This is an over-simplification of the problem, but it works for now. In the future, we may want to distinguish between cases where the parameter type is std::nullptr_t, which means the actual parameter is null, and the case where some type is provided without a name, which indicates that the parameter is not used in this implementation of the function. Task-number: QTBUG-58281 Change-Id: I7d648341262040b9b9ea91f1e27e5905455f9ef2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * | | qdoc: Clean up the Parameter classMartin Smith2017-08-101-3/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way function signatures are specified is changing. A basic assumption of qdoc was that in the function signature specified with the \fn command, each formal parameter would have a name, and the name would be documentede in the text using the \a markup. This is no longer valid. There are now several cases in Qt where std::nullptr_t is used to specify a formal parameter, and no parameter name is provided. Furthermore, there are a few cases where some other type is used as the parameter type and no parameter name is given. The meaning in the first case is that the function must be called with NULL, and the meaning in the second case is that the parameter is not used in the function implementation. This clean up task must be accomplished in preparation for implementing the changes described above. The Parameter class had become a kludge. The so-called "rightType_" data member (which has not been used for quite a long time now and which was marked for removal long ago) is removed here. The change also affects the <parameter> element in the .index file, where the "right" item is removed and the "left" item is renamed to "type" . This index file change might break 3rd party applications that parse qdoc's index files, but I think there is only one, so be on the lookout for a complaint from that guy. Task-number: QTBUG-58277 Change-Id: I721bebdd5d0f2fcd65324373c3a3ec3ea1c33e26 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | qdoc: Set up output directory at Generator::initialize()Topi Reinio2017-11-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although QDoc configures the (format-specific) output directory when generating the docs, we need to have it already when building the node tree. This is because a relative URL is passed to nodes read from index files, and that URL is based on the output subdirectory name. This fixes a linking issue introduced with commit 4c682533. Change-Id: I6a943af8b28cfed60d70d476bd92f220ca7090f7 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | qdoc: Make doc configuration aware of the output formatTopi Reinio2017-10-171-119/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the introduction of the WebXML output format, QDoc can no longer assume that the configuration is specific to HTML. In particular, Config variables: - Output directory and subdirectory can now be set for each format. - 'quotinginformation' can now be prefixed with '<format>.' qualifier. Because the same parsed tree of atoms is used for all generators, we need to include both the quoting information and the related code snippets in the list of atoms; generators then decide what to include in the output. Index files: - Look for index files under the output subdirectory for each specified format. This allows per-format configuration and passing multiple formats in 'outputformats' configuration variable. Clean up and refactor the code related to processing doc config variables. Task-number: PYSIDE-363 Change-Id: I66e9c71311689a777fcb445d3b1a8ef070dff93d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | qdoc: Revive the WebXML generatorTopi Reinio2017-10-171-7/+6
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-07-061-0/+1
|\ \ | |/ | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I10c51b1983bcc48043b89b9aac9780da311ff802
| * QDoc: End "This function is reentrant" with a dotKai Koehne2017-06-221-0/+1
| | | | | | | | | | | | | | Fix \reentrant, \threadsafe output for functions. Change-Id: I192ed48a292ccf7ffcc87b8422ba1f185d9d6629 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | qdoc: Improve example file listingTopi Reinio2017-06-261-7/+30
|/ | | | | | | | | | | | | | | | At the end of \example documentation page, qdoc lists all the files that are part of the example project. This commit does the following improvements: - Sort the example files based on path name - Introduce '\generatelist examplefiles [regexp]', which lists the files (optionally, only those that match regexp) at the specified location. - Enable \noautolist for example pages, to skip generating the the file list at the end. Change-Id: Ic9ae70f9f7de166d314ae489a7bab9a935949fc3 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qdoc: Stop warning about undocumented parameters of function overloadsTopi Reinio2017-04-251-1/+1
| | | | | | | | | | | There are cases where the parameters of an overloaded function differ enough to have everything documented, but also cases where most of them are already documented in the original, or differ only by type. Therefore, leave it up to the writer to decide what needs to be documented. Change-Id: Ibe8f520f7f22bf94c74eb91546e610e085f3d635 Reviewed-by: Martin Smith <martin.smith@qt.io>
* qdoc: Improve \brief handlingTopi Reinio2017-02-141-6/+7
| | | | | | | | | | | | | | | | | | | | | There were several issues with how \brief text was generated, especially for C++ properties and variables. This commit changes the \brief generation by: - Preface a brief with 'This property holds ...' only if the produced text is more or less grammatically sound. - Eliminates 'This property holds this property holds' duplicates. - Allow any formatting within a \brief. Previously, input like "\brief \c true" produced no output. The last issue is fixed also for brief attributes written to index files, although there we cannot retain the formatting. In order to do this, the Generator::plainCode() function was made static. Change-Id: If5b3b7e626e87116c3d8d3c1f777d604e4647eb8 Task-number: QTBUG-58280 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-051-2/+2
|\ | | | | | | Change-Id: I29e1f5d7d146cc77f8cf92bfbe2e41ffad50a041
| * qdoc: Improve resolution of QML type inheritanceTopi Reinio2016-08-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc maintains a global map of base types for all QML types. This caused issues whenever QML modules have conflicting type names; for example, types from Qt Quick Controls (v1) were incorrectly marked as deriving from QQC v2 'Control' type. To improve the situation, make following changes: - Manage 'inherited by' map in a single location. Types are added to this map in a pre-generate step (QDocDatabase::resolveQmlInheritance()) after parsing all sources. This allows better control of searching - if the QML type node has an import list, the search is now always based on it. - Add a safeguard against using a base type from a module with major version different to the import statement. - Use node pointers as keys in 'Inherited by' map, instead of type-name strings. Task-number: QTBUG-53529 Change-Id: I6665a520c9197fa90e84d67b12e3405b5b3f0901 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-301-17/+12
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/assistant/qcollectiongenerator/main.cpp src/qtestlib/wince/cetcpsync/main.cpp src/qtestlib/wince/cetcpsync/qtcesterconnection.cpp src/qtestlib/wince/cetcpsync/qtcesterconnection.h src/qtestlib/wince/cetcpsync/remoteconnection.cpp src/qtestlib/wince/cetcpsync/remoteconnection.h src/qtestlib/wince/cetcpsyncserver/commands.cpp src/qtestlib/wince/cetcpsyncserver/commands.h src/qtestlib/wince/cetcpsyncserver/connectionmanager.cpp src/qtestlib/wince/cetcpsyncserver/connectionmanager.h src/qtestlib/wince/cetcpsyncserver/main.cpp src/qtestlib/wince/cetcpsyncserver/transfer_global.h src/qtestlib/wince/cetest/activesyncconnection.cpp src/qtestlib/wince/cetest/activesyncconnection.h src/qtestlib/wince/cetest/cetcpsyncconnection.cpp src/qtestlib/wince/cetest/cetcpsyncconnection.h src/qtestlib/wince/cetest/deployment.cpp src/qtestlib/wince/cetest/deployment.h src/qtestlib/wince/cetest/main.cpp src/qtestlib/wince/cetest/remoteconnection.cpp src/qtestlib/wince/cetest/remoteconnection.h src/qtestlib/wince/remotelib/commands.cpp src/qtestlib/wince/remotelib/commands.h Change-Id: Ia1b311710f7e8009ca1697faae3ae5e37e80ecc3
| * 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>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-131-1/+1
|\ \ | |/ | | | | Change-Id: Idff3a769724c52de3806697df5b2850cf004d203
| * QDoc: Add a space between "Note:" and "Signal"hjk2016-04-081-1/+1
| | | | | | | | | | | | | | ... in the "Note:Signal ... is overloaded in this class." hint. Change-Id: I4020a43613f655170cf88b03d1c689f3eb3584e3 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.7' into devSimon Hausmann2016-04-061-96/+212
|\ \ | |/ | | | | Change-Id: I6cc44e077f16ecfbe7153048539e8a5ce0c17f1e
| * qdoc: Provide better threadsafeness reportingMartin Smith2016-03-211-93/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation QObject reported the thread-safety of the class in a kind of silly way. It said "Note: All functions in this class are rentrant except for connect(), connect(), connect(), ..." This was confusing to the reader. Now it says "Note: All functions in this class are reentrant." And then it shows a second note that lists all the functions that are thread-safe in addition to being reentrant, but it lists them in a bullet list with their complete signatures, except for the return type. This affects a few other classes that had a similar problem. Change-Id: Icb7f7c5ac2da1c28ef8e5c10736296d80c2aefeb Task-number: QTBUG-41724 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * qdoc: Avoid more unnecessary qdoc warningsMartin Smith2016-02-261-2/+24
| | | | | | | | | | | | | | | | | | | | | | Now avoids qdoc warnings for undocumented copy-assignment operators and move-assignment operators. This update also improves the text output by surrounding it with <p> and </p>. There was also a bit of refactoring. Change-Id: I922c7083d17b9b911d81f818f51fe7623a78eb22 Task-number: QTBUG-50630 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * qdoc: Avoid unnecessary qdoc warningsMartin Smith2016-02-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | Generates default docs when special class member functions are declared but not documented, thereby avoiding the "No documentation for..." error. The member functions now handled are the destructor, the copy constructor, the move-copy constructor, and the default constructor. Change-Id: I9ddd7841b1dfec907ab3c2ccd7636dc898df1fce Task-number: QTBUG-50630 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
| * qdoc: Don't print unnecessary qdoc warningsMartin Smith2016-02-171-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generates default doc for destructor that is declared but not documented, thereby avoiding the "No documentation for..." error. This change reveals several new constructors and assignment operators that are not documented. Most of these will be handled automatically the same way these destructors are handled, but that fix will be in a separate update. Change-Id: Iffb3834b2ea31fd47d578bf1444be2f25a60ae6f Task-number: QTBUG-50630 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Fix "Inherits" textOlivier Goffart2016-03-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't use (*r).signature_ anymore because the signature is not set when we call ClassNode::addResolvedBaseClass The clang model will call ClassNode::addResolvedBaseClass instead of addUnresolvedBaseClass because clang already knows the actual node. And does not do a two step header -> C++ Change-Id: I96c6468f00e378fc2cc81e973e2f6cf30390e850 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com> Reviewed-by: Fredrik de Vibe <fredrik.devibe@theqtcompany.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-031-2/+4
|\ \ | |/ | | | | Change-Id: Ie050ffdb7817c976b3939e9f2f77719b14f10558
| * qdoc: Don't generate empty cells for the requisites tableTopi Reinio2015-10-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The 'Inherits' and 'Inherited by' entries in the requisites table sometime contain nodes referring to internal classes or classes that cannot be resolved due to a missing dependency. Avoid generating requisites with zero items by checking how many items were actually added to the table (row), and skipping empty ones. Change-Id: I0515335618ca4671d5f64db123446ba82960ceea Reviewed-by: Martin Smith <martin.smith@digia.com>
* | qdoc: Remove creation of redundant function & variable nodesMartin Smith2015-10-301-1/+1
|/ | | | | | | | | | | | | | | | | qdoc no longer creates a function node when it parses a function declaration, if a function node for the function already exists. This avoids needless allocation and deallocation. qdoc now also avoids creating unnecessary variable nodes. This change also improves the "No documentation for..." error message so that it includes the parameters if the error refers to a function. This makes it easier to find the correct function when you are trying to correct these errors in the documentation. Change-Id: Ib0f9361622f9115d677408e36bfed77c42545be0 Task-number: QTBUG-48191 Reviewed-by: Martin Smith <martin.smith@digia.com>
* move qdoc back to qttoolsOswald Buddenhagen2015-10-231-0/+2171
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>