summaryrefslogtreecommitdiffstats
path: root/src/qdoc/qmlvisitor.h
Commit message (Collapse)AuthorAgeFilesLines
* QDoc: Move QDoc source files under a further "qdoc" directoryLuca Di Sera2023-04-121-93/+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: Always depend on QmlPrivatePaul Wicking2023-03-041-6/+2
| | | | | | | | | | | | | | | | | | | | | | Make Qml a hard dependency for QDoc. - There are no known usecases for running QDoc without qml support. - We're not testing QDoc without qml support, as it's not officially supported. - There are known issues with parsing certain file types when qml support is missing. - Dropping feature checks makes the code easier to reason about and thus maintain. - Clean up some of the configure and CMake configuration that's affected by the change. [ChangeLog][QDoc] QDoc now requires the library QmlPrivate. Make sure the qtdeclarative module is available. Fixes: QTBUG-111673 Change-Id: I3a8aa20ace3c379c3896b9f59aa4e8113cd9a873 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* 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-22/+22
| | | | | | | | | | | | | * 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix build after removal of qqmlapiversion_p.hVolker Hilsheimer2021-03-221-9/+0
| | | | | | | | Follow up on e4ef78e63fb7193076e5df93260ab0aa1fd1af85 in qtdeclarative, use current version code path. Change-Id: I86261c050b8c4c4d94d3ebab056c4c0837fc76eb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QDoc: Extract Aggregate from NodePaul Wicking2020-06-041-0/+2
| | | | | | Task-number: QTBUG-84578 Change-Id: If28cc8b41401c90dfa48b613211b3d0a4dcd815a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Extract QmlTypeNode from NodePaul Wicking2020-06-041-0/+1
| | | | | | Task-number: QTBUG-84578 Change-Id: Ia3a0010e9791b69ca73d12a1e98322477e1569aa Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Drop half-baked translation effortPaul Wicking2020-06-041-2/+0
| | | | | | | | | | | | | | The current implementation suffers from lack of maintenance. This causes a poor user experience that adds little value, or is even detrimental to perceived value. Work to improve the situation would have to be done at the expense of something else. This patch removes the Q_DECLARE_TR_FUNCTIONS macros from QDoc, and replaces calls to tr() with QStringLiteral(). Fixes: QTBUG-84568 Change-Id: I2df71c27246ca5de816608c887cf359db8f85900 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Prepare for internal QML Parser API changeSimon Hausmann2020-03-021-3/+12
| | | | | | | | | | With the internal API version 8, the SourceLocation will move from QQmlJS::AST to the QQmlJS namespace, and it will get its loc.startLine/loc.startColumn members back. Change-Id: I70ba5a7f7b6eca60298a7b4982bf2cf099110089 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* clang-format QDocPaul Wicking2019-12-171-11/+7
| | | | | | | | | | | | | | | | 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>
* QDoc: Remove empty destructors and add missing override keywordPaul Wicking2019-08-121-1/+1
| | | | | | | | | | | This change removes reduntant destructors. It also adds the 'override' keyword to overridden destructors to remove warnings from clang-tidy in Creator. The patch also replaces two instances of 0 as nullptr constant. Change-Id: I576c248b7d4637249d167d7bfb8885af4f7811ff Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDoc: Clean up whitespacePaul Wicking2019-08-081-3/+3
| | | | | | | | | | | 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-2/+3
| | | | | | | | | | | | | | | | | | | 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>
* Mark throwRecursionDepthError() as finalUlf Hermann2019-03-271-1/+1
| | | | | | Task-number: QTBUG-74510 Change-Id: I4c6e20a55d76e308808f091fb224ee5c612bc239 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Handle recursion depth errors when parsing JavaScriptUlf Hermann2019-03-181-0/+4
| | | | | | | | Implementations of QQmlJS::AST::Visitor are required to do so. Fixes: QTBUG-74510 Change-Id: I061240f15ce082a05dd7829d225a5bfc3edd896a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Replace Q_DECL_OVERRIDE with overrideKevin Funk2017-09-221-17/+17
| | | | | Change-Id: I1b8b338a6bc2f3c87af62c20ff1428096b309628 Reviewed-by: Lars Knoll <lars.knoll@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>
* qdoc: Let qdoc run without QtDeclarativeMartin Smith2016-03-091-0/+4
| | | | | | | | | | | | | | | When qdoc is built without QtDeclarative present, define QT_NO_DECLARATIVE. Then qdoc will not compile the QML and JS parsers from QtDeclarative, and if it encounters a request in the documentation to parse a QML or JS snippet or file, it prints an error message indicating that it can't parse QML or JS because QtDeclarative is not installed. Change-Id: I7e7948118244b7ffa563126520def083d75e3bb6 Task-number: QTBUG-51409 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* move qdoc back to qttoolsOswald Buddenhagen2015-10-231-0/+121
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>