summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* QDoc: Extract method from DocParser::insertTargetPaul Wicking2023-04-282-6/+20
| | | | | | | | | | | | | | | | | `DocParser::insertTarget` has a conditional check at the start of the method, that, if satisfied, causes QDoc to generate a warning. The rest of the method is contained in the else block that follows. This patch extracts a method, `DocParser::warnAboutPreexistingTarget`, that is responsible for issuing that warning, and modifies `DocParser::insertTarget` to return early if the condition is satisfied. This allows further refactoring of the latter method. The new method is fully documented. As this new method impacts the documentation for QDoc warnings, that is also modified in this patch. Task-number: QTBUG-113126 Change-Id: Iba54e67862555fba71ec774261e0e0fbea638238 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-271-3/+3
| | | | | Change-Id: Ifa9e272c1a31619f73c4cf997fdf92b96987454a Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Doc: Fix QDoc warning in QDoc manualPaul Wicking2023-04-271-6/+5
| | | | | | | | | A recent change removed the \alias command from QDoc, and failed to remove a link to it from the QDoc warnings documentation. This patch remedies that mistake. Change-Id: Ia2ef4d095fc548e754312317b4b07f006ccc5a59 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: implement ITS attributes for parts that shouldn't be translatedThibaut Cuvelier2023-04-2627-115/+166
| | | | | | | | | | This patch is a port of b7849d42efff91a4d247a4028d6c129f3742743a for DocBook. Pick-to: 6.5 Change-Id: I0220691da3e0827bc89e05912bcbb723d8490cf5 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc DocBook: add new test suite for the extension tagsThibaut Cuvelier2023-04-2628-3/+1988
| | | | | | | | | | | Explicitly test that the right tags are output when the DocBook 5.2 extensions are enabled. This test suite is made small intentionally, because the extensions do not have an impact on that many pages. Pick-to: 6.5 Change-Id: I6a135ddb20f17034287e0a6d5da4a5b96e064028 Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc DocBook: allow deciding the use of extensions by qdocconf filesThibaut Cuvelier2023-04-261-1/+2
| | | | | | | | | | | | Previously, this parameter could only be set from the command line. Now, it can also be set from a qdocconf file, like almost all other parameters. There was never a reason why it was read only from the command line. Pick-to: 6.5 Change-Id: Ib2877e8f4ef6155ac9434e982331de826d7df18c Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc DocBook: remove use of QStringLiteralThibaut Cuvelier2023-04-261-2/+2
| | | | | | | | | The DocBook generator was the only one using this macro for constants. Pick-to: 6.5 Change-Id: Id2ca3f6e4ffb1caf23cb7a38205dfcc8a7e7dee4 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* DocBook: introduce a member variable to enable 5.2 tagsThibaut Cuvelier2023-04-2618-861/+10
| | | | | | | | | | | | The main goal is to make the code easier to read and check. This way, a bug was found: a reversed condition. Extensions are not supposed to be enabled by default, but still were for parts of the documentation. Pick-to: 6.5 Change-Id: I5425c658d8f8adb368a12967a679b0c09851cf6a Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Make \keyword enforce paragraphsPaul Wicking2023-04-256-4/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc's \brief command takes an entire paragraph as its argument, and also allows for the processing QDoc commands or macros that appear in the argument. Due to QDoc's internals, this may lead to a situation where such commands consume newline characters that the \brief command relies upon as indicator of its end condition, leading to a situation where the \brief command erroneously includes the following paragraph as part of its argument. In particular, this may cause issues for certain commands that "naturally" fit in a document "header". For example, given the following content in a .qdoc file: /*! \page the_page.html \title The title \brief This is the brief. \keyword the_keyword Lorem ipsum dolor sit amet. Santa Mozzarella! */ the brief will contain: This is the brief. Lorem ipsum dolor sit amet. And the only content in the generated output will, unexpectedly, be Santa Mozzarella! Due to its design, modifications to the \brief command are difficult, as they will inevitably change QDoc's behavior significantly, with the possibility of silent breakage. Therefore, enforce that the \keyword command starts ends the paragraph it occurs in before further processing. This change includes a reproducing test case for the behavior in question, which serves to validate the fix as well as as a guard for future regressions. Fixes: QTBUG-70959 Change-Id: I8f5b8a4aebf2ed2040bf43c1d4551ec280fc895a Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Improve CMake macro docsLeena Miettinen2023-04-251-12/+17
| | | | | | | Task-number: QTBUG-113116 Pick-to: 6.5 Change-Id: I5ea9291d8ca4dce13a26d1d70874223e63a09671 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* qdoc: Allow custom status descriptions for C++, QML typesTopi Reinio2023-04-246-16/+37
| | | | | | | | | | | | | | | | | | QDoc already allows defining a custom status for C++ and QML modules via the \modulestate command. In Qt, this is typically used for marking a module and its types with 'Technology preview' status. Allow a custom status for individual types as well, with \meta {status} {<description>} command. This information is added to the 'Requisites' table on top of the type reference page. Document the new status argument for \meta, and update its documentation as it contained obsolete information. Pick-to: 6.5 Task-number: QTBUG-113026 Change-Id: I5a13aa8650b6e188ffe50a1e948da90474bfb7a0 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* qdoc: Add status information to the requisites table for typesTopi Reinio2023-04-2413-4/+184
| | | | | | | | | | | | | | | | | | | QDoc provides various ways to document the status of an entity; \deprecated, \preliminary, and \modulestate commands. These commands produce a brief sentence describing the status, however, for C++ and QML types, a logical place for this information is also the 'requisites' table at the start of the page. Having the status information in the table makes it more apparent for the reader that they're looking at documentation for a deprecated or preliminary type. For HTML generator, this commit also adds a <span> element that allows additional visuals via CSS (e.g. an icon) for a specific status. Pick-to: 6.5 Fixes: QTBUG-113026 Change-Id: If38a6d51631277a0d98b2cb702acf2598b694643 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* qdoc: Rename transmogrify() and move it under Utilities namespaceTopi Reinio2023-04-243-41/+48
| | | | | | | | | | | | | | | | | The transmogrify() function was used by the Generator to produce clean output file names by replacing all non-alphanum characters with hyphens. This function is useful elsewhere as well, especially in HTMLGenerator, as it produces valid strings for use as HTML attribute values. Rename the function to a more descriptive canonicalizeFileName(), move it to the Utilities namespace, improve its documentation and touch up the implementation a bit; make it return a QString instead of modifying a string passed as an argument. Pick-to: 6.5 Change-Id: I6088f4603802b86f96c4a5b668668ef229b302f3 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-241-3/+3
| | | | | Change-Id: Ifc9118c0b0947adc7f7623ec412e0e186799907a Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* QDoc: Flatten DocParser::leavePara()Paul Wicking2023-04-211-17/+18
| | | | | | | | | The entire method sits behind an `if`. Inverse the logic of the conditional and return early. This allows for flattening the whole method. Change-Id: I849f089bf4c84b4715eaeb0d2863f7c6fff24c96 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* QDoc: Flatten DocParser::enterPara()Paul Wicking2023-04-211-17/+17
| | | | | | | | | The entire method sits behind an `if`. Inverse the logic of the conditional and return early. This allows for flattening the whole method. Change-Id: I611a69bfd8850ff59e726b10d22801a3fac0527f Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* Qt Designer: Replace QLatin1Char by modern literalsFriedemann Kleint2023-04-2146-188/+151
| | | | | | | Pick-to: 6.5 Change-Id: Ied11784e840d03542a5db281590729838ed625c3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-201-3/+3
| | | | | Change-Id: I3875865fbbdd1cbfcf5c9f0f3307c370a874c7ca Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* hellotr: Clarify that .ts file is generated in the source directoryTor Arne Vestbø2023-04-191-1/+1
| | | | | | Pick-to: 6.5 Change-Id: Id738952b6515449ec0c5f7d66e8c89352333d7ad Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* lrelease: Report all occurrences of duplicatesJoerg Bornemann2023-04-194-15/+35
| | | | | | | | | | | Before, lrelease reported only the line number of the first of duplicated messages. To actually resolve the duplicates the user must know the occurrences of all duplicated messages. Now, lrelease reports the line numbers of all duplicated messages. Change-Id: I19836f54dcaa9b1d22a9e3e708f830769c50bff2 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* assistant: Remove unused network dependency from help/qhelpgeneratorJimi Huotari2023-04-192-2/+0
| | | | | | | | | It seems the Qt Network libraries are not required for the Help module, nor the qhelpgenerator tool. Change-Id: I4c08c052a6daa62e65357ecc1f452ee150cd6172 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* qdoc: Add \details commandJaishree Vyas2023-04-1911-1/+98
| | | | | | | | | | | | | | | | | The command \details generates a collapsible <details> element with a <summary> to control the hidden/visible state. The idea behind this is to provide more information with less text on our main pages. For output formats other than HTML, the details are rendered as a normal paragraph and the summary string is ignored. Pick-to: 6.5 Change-Id: Id5daddd4854f22b9ceaa9a55b98af94a1ba06039 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-191-1/+1
| | | | | Change-Id: I72e4e2e439f3352e25df48d6b4afd53b8addfaba Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-181-3/+3
| | | | | Change-Id: Ie516cfdf0f5125f4d933017eef32a425b67a7d8a Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* CMake: Add note about CMake version requirementsAlexandru Croitor2023-04-181-0/+6
| | | | | | | Pick-to: 6.5 Task-number: QTBUG-112841 Change-Id: I1d7f394c52f609302711da2dcd71df9fe8ad8e88 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Mark qm files as GENERATED in the target scopeAlexandru Croitor2023-04-181-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Projects with cmake_minimum_required(VERSION 3.19) or below, so with no support for the CMP0118 policy, failed to configure when translations were added in a subdirectory scope different from the target scope. qt_add_translations adds qm files to resources, that in turn calls _qt_internal_expose_deferred_files_to_ide which adds the qm files to the target sources. Because qm files are created using add_custom_command, which by default marks the files as GENERATED only in the directory scope of the command (unless CMP0118 is set to NEW), that causes add_executable to think the qm files are not generated, and error out with "Cannot find source file:". Explicitly set the GENERATED flag in the target directory scope to avoid the issue when using CMake 3.18+. The error still happens with CMake 3.17 or lower, but that's not the only error that happens. Just adding resources in a different subdirectory without exposing the source files already fails, and that's not something we can really fix without a newer CMake version. Pick-to: 6.5 Fixes: QTBUG-112841 Change-Id: I79eced94ac641a6f9239f3eb721cef5e35f847fa Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* QDoc: Remove relative paths to QDoc files from QDoc test projectsLuca Di Sera2023-04-145-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc tests are organized into a series of different projects under the "tests/auto/qdoc" directory. Many of those projects uses a subset of QDoc source and header files to perform tests on a subset of QDoc functionalities. The CMake target description for those projects refers to those required files through the use of relative paths, going back up and down the filesystem structure to the "src/qdoc" directory and the files themselves. Due to a recent change in QDoc directory structure, those relative paths were broken, breaking the tests as a consequence, thus requiring modification to test projects' "CMakeLists.txt" files to align to the new structure. While we don't expect QDoc directory structure to change often, we can reduce the friction of doing so in the future by centralizing the definition for the base path of those relative paths. To do so, "tests/auto/qdoc/CMakeLists.txt", the "parent" "CMakeLists.txt" file to QDoc's test projects, was modified to provide two variables, `QDOC_SOURCE_DIRECTORY` and `QDOC_INCLUDE_DIRECTORY`. Both variable refer to a suitable path that can be used as the base for finding source file and header files, respectively. The "CMakeLists.txt" files for the affected test projects were modified to use `QDOC_INCLUDE_DIRECTORIES` in the `INCLUDE_DIRECTORIES` property for their test target, replacing the relative path to the QDoc source directory. Similarly, they were modified to use "QDOC_SOURCE_DIRECTORY" as the base path for the inclusion of C++ source files under the `SOURCES` property of their test target. Some of the test project target included certain used headers files under their `SOURCES` property. As the availability of those headers is implicit under the provided `INCLUDE_DIRECTORIES` property of the target, all paths to headers files were removed from under the `SOURCES` property. Albeit a restructuring such as the one that was performed would still break the tests configuration, having a single place of failure to change is expected to alleviate the issue. Change-Id: I9f0bd42a61a7dd436d70e19e7d38820bf9b54662 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-131-3/+3
| | | | | Change-Id: Ie31560355df18a300c01832befdcdc4b2a37e920 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Place the QT_END_NAMESPACE in the right placeAmir Masoud Abdol2023-04-136-12/+12
| | | | | | | | | Moving the QT_END_NAMESPACE before the #endif of the include guard. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I13f8e71aca28b8dacbe00d7006f4e7ef807a9904 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QDoc: Don't write type attributes to index files for macrosPaul Wicking2023-04-134-13/+15
| | | | | | | | | | | | | | | | | | | | | | | | | QDoc includes a number of attributes when generating index files. Internally, QDoc uses the `FunctionNode` data structure to represent invokables. This data structure includes the return type for the function or method such a node represents. However, not all invokable entities that are represented internally as a `FunctionNode` carry a return value. This applies in particular to preprocessor macros in C and C++. When generating the index files. QDoc writes an empty `type=""` attribute for `FunctionNode`s that represent a macro. When reading the values back in, the value for the `type` attribute defaults to empty is the attribute is missing. Therefore, writing this out in the first place leads to unnecessary clutter in the index files. This change modifies QDoc's behavior such that these attributes are only written to the index file if they exist. Test data for the `generatedOutput` test is updated to reflect the new content of the index files covered by that test. Task-number: QTBUG-112494 Change-Id: Id6e3a730cbde098068029af1ebf9fa17bd2a4441 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Remove unused \qmltext | \endqmltext command pairPaul Wicking2023-04-1313-104/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc offers the `\qmltext` and `\endqmltext` command pairs, dating back to sometime prior to when QDoc moved to qttools.git in 2015. The commands have since been considered tags not to be handled specifically when generating documentation. The commands have not been documented. Upon inspection of source code across Qt and its modules, no usage of the commands have been found, with the exception of the generated output test for QDoc itself. Even though unused and considered "only tags", the `Generator`, `HTMLGenerator`, and `DocBookGenerator` classes still implement methods to handle them and generate output for them. The removal of the commands therefore necessitates removal of the methods that deal with them. As the command pair is unused, removing the related code is a way to reduce the surface of QDoc's generator classes, making them slightly better suited for testing. This also improves the maintainability of QDoc. This change thus removes the commands and the related `Atom`s, as well as any method designed to deal with those `Atom`s. In addition, the test data and expected output for the generated output test is modified to accommodate the behavior change. Fixes: QTBUG-112764 Change-Id: I2b0a57783ccdccd3e8c1693e6946ecf07777f3b6 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* QDoc: Remove unreachable code in WebXMLGenerator::addAtomElementsPaul Wicking2023-04-131-8/+0
| | | | | | | | | | | | | | | | | When the WebXML generator was revived in 2017, a case for handling QML atoms in the method `WebXMLGenerator::addAtomElements` was added under an `#ifdef QDOC_QML` guard. This is, according to esteemed historians, a remnant from the old Qt 4.7 implementation of the WebXML generator. However, since the revival, the define wasn't ever set by anything in neither QDoc nor the build system, effectively rendering this code unreachable. This change removes the `#ifdef [...] #endif` block, as removing the unused code won't lead to behavior change of QDoc. Task-number: QTBUG-112764 Change-Id: Ib9b50d4831e86c60de05065d315f421ae2289f64 Reviewed-by: Luca Di Sera <luca.disera@qt.io>
* Doc: Remove unused image from QDoc manualLuca Di Sera2023-04-131-0/+0
| | | | | | | | | | | | "qa-table.png" is currently unused in the containing documentation. Supposedly it showed an old feature of QDoc that is now not available anymore. Hence, it is now deleted. Change-Id: I043f718a0f298d4f57e1bf897ab6d51fd51eee88 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Qt Designer: Replace QString::fromUtf8() by modern literalsFriedemann Kleint2023-04-1319-62/+76
| | | | | | Pick-to: 6.5 Change-Id: If0aff3c1a767e6830f5480f57dfe82a66feb124c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-121-3/+3
| | | | | Change-Id: I61ca0226fdc4a696453e18c0ae82aecfb31047f6 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* QDoc: Move QDoc source files under a further "qdoc" directoryLuca Di Sera2023-04-12173-124/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix links in \generatelist <groupname> outputTopi Reinio2023-04-118-21/+90
| | | | | | | | | | | | | | | | | | The \generatelist command already supported listing members of a group as a simple unordered list of titles/links, but the links were broken as they always referred to the current document. In DocBook generator, reuse generateAnnotatedList() for this purpose as it already has support for outputting simple itemized/unordered lists. Create a new private enum GeneratedListType to select the list 'subtype' and clean up the API. Add simple test case and documentation of the new argument. Fixes: QTBUG-111575 Pick-to: 6.5 Change-Id: I30e4976cef3b6aa5414aac457844ae5bc0762f3d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Revert "qdoc: Add support for 'category' argument in \generatelist command"Topi Reinio2023-04-1112-130/+27
| | | | | | | | | | | | | | | This reverts commit df735050ecd01687f17df8f161c706541319ad05. While the commit works, it introduces unnecessary complexity to the processing of the \meta command. The same functionality can be achieved with the help of a documentation macro. The commit did contain a bug-fix for the \generatelist command, which is re-introduced as a separate change. Pick-to: 6.5 Change-Id: Ie8578baa35cfee210fc52428c610307f51103d22 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Use the \examplecategory macro to tag examplesTopi Reinio2023-04-1111-11/+11
| | | | | | | | | | | | | | | | The '\meta category' command was used for tagging examples with a specific category, used in Qt Creators Welcome mode. As we want to also generate lists of examples belonging to a category elsewhere in the documentation, replace the command with a macro that expands to the original \meta command and also adds the example to a group using the \ingroup command. This way, the category names can be used as arguments to the \generatelist or \annotatedlist commands. Pick-to: 6.5 Task-number: QTBUG-112731 Change-Id: I28dfd6d5540dfe540bab942f9e9a93e9c239e206 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QDoc: Be const correct in QDocIndexFilesPaul Wicking2023-04-111-6/+7
| | | | | Change-Id: Ic6f1e5d1e2d7468b522ce7d5209cc73c7bb80c5c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-111-3/+3
| | | | | Change-Id: I824511492d64469084237aa8eecbdd33d9faa334 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Qt Designer: Replace QLatin1String by modern literalsFriedemann Kleint2023-04-1117-74/+60
| | | | | | | Pick-to: 6.5 Change-Id: I1a76bf2224795275a8c62cf37144936bda87cbca Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDoc: Prevent crash in WebXMLGeneratorPaul Wicking2023-04-078-1/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `WebXMLGenerator::startLink` is responsible for writing the WebXML tags for links. The method takes a pointer to `Atom`, from which a string is obtained for use in parts of the output. In most locations, the callee pre-qualifies the validity of the pointer it passes to the method (e.g. `if (atom) startLink([...]`). However, there's an exception to this in `WebXMLGenerator::generateAnnotatedList`, which calls `Text::firstAtom()` -- that may return `nullptr` -- in the call to `startLink`. This is considered a valid use-case that occurs when there's only title/meta commands and no body in the documentation. In such a case, or if the string obtained from `Atom::string()` is empty, `WebXMLGenerator::startLink` is designed to fall back to the full name of the `Node` being processed. However, in the case when generating a link for an example, `Generator::exampleFileTitle()` is called to obtain a file name for the example, and the `Atom*` is dereferenced to obtain a string is input for the latter method. At that point, the `Atom*` may be an unguarded null pointer. This change updates the generatedOutput test for QDoc by adding a minimal documentation project that serves as means to reproduce a bug that was observed in Qt3D, and fixes the bug in QDoc. The documentation project is designed such that the preconditions outlined in the first paragraph are met; that is to say, the structure of the documentation is such that, for an `Atom` that's constructed while generating the documentation set, `Atom::firstAtom()` is going to return a null pointer. The change to the test serves to validate the bug fix as well as to guard for future regressions. Avoid the crash that would occur when dereferencing this null pointer in `WebXMLGenerator::startLink` by checking the validity of the `Atom*` before dereferencing it to obtain a string used as file title when generating a link for an example. Fixes: QTBUG-112641 Pick-to: 6.5 Change-Id: I3633e5473b60013968becac4cd7bdacdbbdcb9ff Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Qt Designer: Replace QStringLiteral by modern literalsFriedemann Kleint2023-04-07108-1117/+1256
| | | | | | | | As a drive-by, extend the list of C++ keywords checked for naming. Pick-to: 6.5 Change-Id: I37b095d0fa29b9c431b7ad11bb5f962a8eeb5d79 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Qt Designer: Fix editing horizontal alignment propertiesFriedemann Kleint2023-04-061-1/+1
| | | | | | | | | | Fix slot connection, amending f6c9325f639d882992bb3c6386185defd2090498. Pick-to: 6.5 Fixes: QTBUG-112682 Change-Id: Idb325f31ed8f454433f4b8d28183a571877972ff Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Update dependencies on 'dev' in qt/qttoolsQt Submodule Update Bot2023-04-051-3/+3
| | | | | Change-Id: I93963f5341faa2a7e400ee85b3a7fb21a0fc66dc Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* QDoc: Don't write default attributes to index filesPaul Wicking2023-04-045-89/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc includes a number of attributes when generating index files. Some of these include the default value the attribute has when reading the index files back in, such that the overall effect of writing them to the index file in the first place is none at all for QDoc. For example, for a function that isn't virtual, const, static, final, or overridden, the index file contains the attributes virtual="non" const="false" static="false" final="false" override="false" This change modifies QDoc's behavior such that these attributes are only written to the index file if they are true. This reduces the size of the index files generated for Qt by approcimately 7.16%. Test data for the generatedOutput test is updated to reflect the new content of the index files covered by that test. [ChangeLog][QDoc][Index files] QDoc no longer writes the attributes virtual, const, static, final, or override, to the index files, unless the attribute is part of a function or method's signature. This reduces the file size of index files somewhat. Fixes: QTBUG-112494 Change-Id: I7d25dc429749dd29dbdcd65b7ca78a51ced5dd0f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Ensure FunctionNode sets sensible virtualness valuesPaul Wicking2023-04-042-6/+5
| | | | | | | | | | | | | | | | | | | | | The index files generated by QDoc contains an attribute for a function's "virtualness"; that is, if the function is a virtual, pure virtual, or not virtual. These attributes are written to the index file if they exist, and read back in, again if they exist. For functions that do not have this attribute in the index file, a virtualness of NonVirtual is implicitly assumed. This change explicitly initializes the responsible member variable, FunctionNode::m_virtualness, to NonVirtual. Furthermore, the setter overload setVirtualness(const QString&), which is called only when reading an index file back in, is modified to handle the special case for pure virtuals first, then setting m_virtualness to Virtual if that's the case, and NonVirtual for any empty, missing, or unknown attributes. Task-number: QTBUG-112494 Change-Id: I8f08b72ae58dca5da07932f010da230c667b056c Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QDoc: Extract method from QDocIndexFiles::generateFunctionSectionPaul Wicking2023-04-042-8/+27
| | | | | | | | | 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: Remove unused method from FunctionNodePaul Wicking2023-04-031-1/+0
| | | | | | | | | | | | | | | | | | | The FunctionNode class contains the public method setVirtual(). The method's intent is to set the private member m_virtualness to FunctionNode::Virtualness::NormalVirtual. This behavior is achieved, and exercised in QDoc, by calling another method of the same class, setVirtualness(Virtualness), which offers the option of passing any value from the FunctionNode::Virtualness enum, making that API more flexible than that of setVirtual() which doesn't take any arguments. As the private member is set in code by a different setter, and because the setVirtual() method is unused, remove the latter as dead code. Task-number: QTBUG-71176 Change-Id: Ieab1fa5b6be92e481fc9df887816fec3f08bbdaf Reviewed-by: Topi Reiniö <topi.reinio@qt.io>