| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
Since dropping support for QDoc's alias configuration
variable, DocParser::terminate() is a noop. Drop the
method.
Task-number: QTBUG-111670
Change-Id: Ic9f1e44d3d87a7c13353dc2538735003febf6484
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For "compatibility reasons", support for renaming commands through an
"alias" defined in a .qdocconf-file was introduced to QDoc. In
particular, this was an aid when renaming QDoc's \input command to
\include. This usage has since been unified in Qt, with the exception
of in QDoc's own documentation project, and the more powerful \macro
command can be exercised to achieve the same behavior.
This feature's implementation obstructs efforts to make QDoc's code more
thread safe. As there are no known usecases, remove support for renaming
commands to pave the way for a more performant QDoc.
[ChangeLog][QDoc] Support for the 'alias' variable in qdocconf-files is
removed. Use QDoc's 'macro' construct instead.
Fixes: QTBUG-111670
Change-Id: Ifcf8a47ee1e1940607cec4841e6ba06b493e6d24
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Config stored an internal Location, used for error reporting. This
location instance was updated whenever a config variable
was queried. This prevented parallelization of code that accesses
Config via the singleton instance.
Remove Config::lastLocation, and move functions that return a
configuration variable as a string, string list, boolean, etc. to
ConfigVar itself. Keep existing access functions in Config as
simple wrappers.
Provide Config::get() that returns a reference to ConfigVar, and
provide location info via ConfigVar::location(). This allows call
sites to get location info for a configuration variable on demand.
Change-Id: I72c6f5cec699e44aa2f3164e6019a04adbd1ab07
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
- remove unused variables
- Use QString::arg() with multiple string arguments
- Avoid detaching containers in loops
Pick-to: 6.4
Change-Id: I9b29f5a0269f288b7de862eccdcee9750248dce8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QDoc supports multiple versions of macros, one for each supported output
format:
macro.hello.HTML = "<p>Hi, \1</p>"
macro.hello.DocBook = "<db:para>Hi, \1</db:para>"
Macros can also take arguments. However, with multiple format-specific
versions defined, QDoc attempted to also read the arguments multiple
times. This fails on the second attempt as the internal position has
been already advanced beyond the arguments.
Implement a new helper function, DocParser::getMacroArguments(), and
use it to read the arguments only once.
Fixes: QTBUG-108219
Pick-to: 6.2 6.4
Change-Id: Icad7e51b93c00a2632746ea2fe05d36459b9acda
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: I95f6410e57a6a92b1cf91bbedfbe3d517cab6b44
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recently added `FileResolver` abstraction encapsulate the logic that
QDoc uses for finding user-provided files in the documentation that QDoc
will need to interface with.
Previously, this process was mostly contained in `Doc::resolve_file`.
This was considered problematic as `Doc` is an extremely complex class
with many responsibilities, coupling the logic with many unrequired
preconditions and making testing of this simple logic almost
unattainable.
Furthermore, a similar logic in QDoc was provided by `Config::findFile`,
which was sometimes used instead of `Doc::resolveFile`, fracturing the
behavior of the code.
To avoid those issues, allow for the testing of the logic for file
resolution and to generally simplify the code and make it more
consistent, `Doc::resolveFile` was removed and substituted with the
`FileResolver` abstraction.
A few changes were made to support this new idiom.
- An instance of `FileResolver` is now built in `processQdocconfFile`
and passed as a reference to systems that require it during
construction.
A small exception was made for `DocParser` where the instance is passed
as a pointer through `DocParser::initialize` to support the current code
structure.
The required changes to the relevant entities constructors were made to
allow for this.
- `FileResolver` is provided as an explicit dependency to anything that
requires the capability of resolving files, such as generators.
Generally during construction.
This is intended as a first step in removing the intitialize-terminate
idiom, reducing the scope of some of the mutable state and increasing
the expliciteness of its provenance.
To allow for this, the main routing of QDoc was modified to construct
the Generators classes during the production of the documentation in
`processQdocconfFile`.
This was required as an initialized `FileResolver` is needed for the
generators to work. As `FileResolver` instead depends on a parsed
configuration, it was not possible anymore to construct the generator
once before doing anything else.
A small defensive addition to `Generator::terminate` was added, removing all
generators from the list of generators. This should not actually be
required, but it was added to ensure that the now more limited scope of
the generators and the possibility that they would be constructed more
than once would not collide with their broader, unrequired global scope.
- To take into account the simplified data requirements for
`FileResolver`, compared to the previous logic, such the usage of a
single list of directories, the extraction of relevant values from the
configuration in `processQdocconfFile` was modified to further mold the
data into a suitable format for `FileResolver`.
- As the data is relevant to searching directories is contained within
the `FileResolver` instance that underlying systems use and does not
require any processing to be retrieved, some of the caching members in,
for example, `Generator` that contained a reference to this data were
removed.
See, for example, `Generator::s_exampleDirs`.
As a consequence of all those changes, `Generator::augmentImageDirs` and
`Generator::setImageFileExtensions` were removed as unused.
- `Generator::generateExampleFilePage`, was modified from having two
overload to a single method with a default argument to reduce the bloat.
- `Generator::addImageToCopy` was modified to use a `ResolvedFile`.
The method copies an image from the examples to the output directory.
This should be done only when the image is available.
- Places where `Doc::resolveFile` were called were modified to use
`FileResolver::resolve`.
Due to this change some underlying methods were modified to require a
`ResolvedFile`.
`Doc::resolveFile` was removed as a consequence.
- `Doc::quoteFromFile`, which previously depended on `Doc::ResolveFile`,
was modified to require a `ResolvedFile`.
This lightens the responsibility of the method to quoting only, instead
of finding the file and quoting, ensuring that it is called only when
the quoting can actually happen. Furthermore, it removes the need for
some of the error reporting which is bubbled up to the caller during
file resolution.
This was further required to avoid having `Doc` require a `FileResolver`
instance, as `Doc`'s constructor is called in many places.
- The usage of a `userFriendlyFilePath` was removed from code using
`Config::findFile`.
A run of QDoc on the current documentation shows that
`userFrinedlyFilePath` is always equal to the original path that was
passed to find file except in two cases where `userFriendlyFilePath`
would be null.
Consumer code didn't seem to make any use of the null state of the
`userFriendlyFilePath` and ignoring it doesn't seem to change the output
documentation, such that it was considered safe to avoid.
It is currently unclear what the original purpose of this element was.
As `Doc::resolveFile` implicitly used `Config::findFile` and exposed
back the `userFriendlyFilePath`, this is true for all replaced usages of
the method too, which allowed ignoring the element in the first place.
- A now unused overload of `Config::findFile` taking a series of
extensions for the searched for file was removed.
- `Config::copyFile` was modified to remove some of the processing done
to its input parameters which is now unused.
A simplified version of it was retained to handle a known case that is
actually used by the code.
- `DocParser` was modified to internally make use of `FileResolver` for
when resolving files for quoting and some code handling.
It previously used a mix of `Doc::quoteFromFile` and its internal
`quoteFromFile`.
The usages were made consistent depending only on the internal
`quoteFromFile`.
`quoteFromFile` itself was further changed to take into account the
changes in `Doc::quoteFromFile`, now resolving the file itself.
- Some of the code was littered with TODO and REMARK comments to keep
track of things that were noticed during the change that will not be
addressed at this point in time.
Change-Id: Ifb2e03696f6de64dac54470f7a969d323a88c0a7
Task-number: QTBUG-100381
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-101408
Change-Id: If6f25418bf3af66ad9bde2dba8bf529b8d202f83
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When QDoc parses a block-comment, it produces an intermediate
representation of `Atom` types that is later used as the processing base
to generate the required output.
To ease the process of inspecting this representation for debugging or
learning purposes, a new command-line-option, `atoms-dump`, was added.
When `atoms-dump` is passed as an argument, QDoc will print a
human-readable `Atom`s structure for each block-comment that is parsed
during its execution.
The information is printed in `Doc::Doc`, the only call location for
`DocParser::parse`, along with information about the starting and ending
location of the relevant block-comment.
A previously unused function, `Text::dump`, centralizes the logic of
generating a human-readable form and the action of outputting it.
`Text::dump` was slightly modified to emphasize the relation between
consecutive atoms enclosed in a block-like structure, such as those
between a `ParaLeft` and `ParaRight` atom.
An unused function, `Atom::dump`, was removed.
The function duplicated parts of the code of `Text::dump`, but for a
single atom.
To avoid spreading the surface of side-effecting functions and to avoid
splitting the responsibility of formatting atoms in a
human-readable-form, the function was not used as part of `Text::dump`
and was, hence, removed as superfluous instead.
Fixes: QTBUG-97775
Change-Id: If2933139575f97640e87f27c8ab1dbcbf7d14171
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QDoc provides a mechanism for tagging specific function declarations
in a header with //! [tag] comments, allowing these tags to be
referenced in an \fn command. This feature did not work for
shared comment nodes containing multiple \fn commands, however.
To make this work, we need to associate the 'bracketed args' (where
the id tag is) with the command itself - previously it was stored
in the Doc instance, but that doesn't work when there are multiple
topic commands sharing a doc. To do so, repurpose the ArgLocPair
structure to store the bracketed arg instead of a Location, as we
never used this particular Location for anything, anyway.
Pick-to: 6.2
Fixes: QTBUG-95948
Change-Id: Ic899d4252d705f84ba56ea201a55f3e5db068f00
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows users to specify an optional parameter
to the \deprecated command to record which version something
was deprecated. It also allows for free text descriptions.
These descriptions become the first paragraph of the resulting
documentation.
Usage:
\deprecated
\deprecated [6.2]
\deprecated [6.2] Use QFoo() instead.
\deprecated Use QFoo() instead.
[ChangeLog][qdoc] QDoc now lets you record the version something
is deprecated and suggest replacements with the \deprecated command.
Task-number: QTBUG-58249
Change-Id: I27081627132b2f8ea3dd7d48ded8e37213366074
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Task-number: QTBUG-84578
Change-Id: Ia3a0010e9791b69ca73d12a1e98322477e1569aa
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
The bulk of Doc's implementation file is the DocParser class.
Extract this class to reduce the size and complexity of Doc, to improve
testability of both classes.
Fixes: QTBUG-84004
Change-Id: I44cc1ff50aaa7a29c06773761ed3860e1582926e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
| |
Provide access through a singleton object so that access can be
obtained by including a header. Break dependency on code location.
Task-number: QTBUG-84004
Change-Id: I0c66c8d6e5e4d1b8e40a83053c274518469f1285
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Collect common typedefs and globals in a single entity
to allow for easier refactoring of contents in doc.cpp.
Task-number: QTBUG-84004
Change-Id: Id51edb98426e759bda55114820e7025a5281b603
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
|
|
|
|
|
| |
Change-Id: I2c9eb349a92503afcdd41bacf556e561d9f8c098
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Drop the Q_GLOBAL_STATIC and return QSet<QString> on the stack
if we don't already have one. Do not return const-ref as the
QSet is implicitly shared anyway.
const-qualify a receiving container.
Task-number: QTBUG-84004
Change-Id: I8e06eb32f6ba82aeae1b727c777c5118c1f1d24f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The Macro struct is used by the Doc and DocParser classes.
Extract it so that it may be included by the classes that need it.
Also extract Topic and a related typedef for the same reason.
Task-number: QTBUG-84004
Change-Id: Ia6b277c392f32d9f8a92af966acc7762abc54f04
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-84004
Change-Id: I498194c384185aa08dde28d605a342b8eba25c76
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
| |
Prefer ranged-based for; improve variable names.
Task-number: QTBUG-84004
Change-Id: I2785ebe6d7236d14fd8bc649392c9dd7fb9254f5
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-84004
Change-Id: I5de4cd1103a02bb40a8b01a0825ece6e01d49c19
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-84004
Change-Id: Id9d80d2afb309b5873f7188905c13c975fe819bf
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the DITA related code has already been pulled out of QDoc.
Separate the Dita-specific classes from Doc to remove clutter and ease
further removal efforts.
Task-number: QTBUG-71176
Fixes: QTBUG-83930
Change-Id: I56ff148bb01d0edf1a9dce3b181a916c4ec20e88
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
| |
* Remove unused includes
* Replace deprecated C++ includes with counterpart.
Task-number: QTBUG-71176
Change-Id: Ie3224d9f9c19fd8f93879de6c7604a8db421b88b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Drop code that is unused in QDoc (YAGNI).
If we decide to make use of this code in the future,
we can always revive it.
Task-number: QTBUG-71176
Change-Id: I1486bc01a2795453587d4025f031bc4eb941a911
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
QDoc allows macros to be nested, and macro parameters can also be
other macros, but in one code path the parameter was read verbatim,
i.e. not expanded. This is an unnecessary restriction so remove it.
Fixes: QTBUG-83085
Change-Id: I6dc7c2f7586a65bee78096fb50685262dad2ffe3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
| |
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.
Change-Id: I7137cf8339bfe9fdcf4cb7cc695cb146aef410fb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The command was documented as taking no arguments, and any arguments
were ignored. The documentation still has many instances of
\obsolete Use somethingElse() instead.
Where the description was lost. Force a linebreak after the command,
allowing any arguments to be processed as a normal text paragraph.
[ChangeLog][qdoc] Generate output for arguments passed to the \obsolete
command.
Fixes: QTBUG-82558
Change-Id: If3e39382367a0c1f4cc63a2c322e986e053ecd6b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since skipSpacesOnLine() can end up making pos == len then we need to
check pos is less than length before querying input_ with that position.
This fixes the warning "Using QCharRef with an index pointing outside
the valid range of a QString. The corresponding behavior is deprecated,
and will be changed in a future version of Qt."
Fixes: QTBUG-80346
Change-Id: Ica1c57f616c3efaefd597ebb84e52b17325d22fa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
| |
Change-Id: I98eaf748fdfb34f32d187718459327b8eef9c54b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
| |
Run clang-format across QDoc, this is the result.
Change-Id: Iaabad0a07a0495990013cbf5995c65db531a7d0d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no need to pass a pointer to Config throughout
the API; the only instance of it is created in main()
so we can turn it into a singleton.
Having access to Config without API changes makes
implementation of configurable features easier.
Change-Id: Ida47e067865082dfe036a7a97f7f1ffc736db346
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
* Make calling code specify Atom type, remove superfluous ctor.
* Move default initialization from initialization list to in-class
for member that initializes the same in all ctors.
* Move initialization from ctor body to initialization list.
* Mark trivial dtor default.
Change-Id: I5e4a9e5cdcf0b9f3ba68b53dcab34c2ab77b415d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
| |
Whitespace that got reintroduced from an old patch that
integrated late. Fix it separately to avoid mixing with
other changes.
Change-Id: I6e905cd5710a31c671702a6ad9f5711b251e1020
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QDoc automatically generates hyperlinks for words that qualify for
auto-linking. This may become a problem whenever there is a qualified
word as a section or a page title, and that word appear in the
documentation frequently. For example, 'macOS' is mentioned often
and each occurrence is linked, which is unnecessary and sometimes
confusing.
Provide a way to exclude specified words from being auto-linked.
Create a new helper function, DocParser::isAutoLinkString(), to
determine whether a string qualifies, and replace duplicated
code with calls to that function.
Fixes: QTBUG-79135
Change-Id: Ie53fe7ca0692f7b8e10a5f2208df5cd2ee2aab1d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the use of QVector in most of QDoc.
Also, remove one redundant C-style cast to int for result from method
call that returns an int. As this happened in a macro, the result is
removing a whole bunch of nagging from code inspection.
Fixes: QTBUG-80669
Change-Id: Ib1aed95e01eaddd1e1213a145e815a0c4753ac67
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
|
|
| |
Pre-increment instead of post-increment for efficiency and readability.
Change-Id: I10b33360dd36cd1d0f4338441c1ad4724551e80e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
| |
Drop casting ints to int.
Change-Id: I571f3e245bfc97a7c0c7bea5bedbf0ed5ab04c60
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
- Use ranged-based fors where applicable.
- Use auto keyword for iterators.
- Move a few variable declarations to where they're to be used.
- Update docs where applicable.
Fixes: QTBUG-80536
Change-Id: I859440b96428dec4ef108b01d391479d3f8dbd83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|
|
|
|
|
|
|
|
| |
Improve readability by pre-incrementing instead of post-incrementing.
This should also improve performance slightly.
Change-Id: Icec66867dfdb04a65e3fe3229d21e2cda98eebb9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change replaces the use of foreach with range-based for throughout
QDoc. It also ensures that the loop body doesn't modify the container
being iterated over, by:
- Making a const copy when the container is a member variable or the
result of an expression, and iterating over that copy. This is the
preferred approach.
- Using qAsConst() when the container is a (static) member variable
or local to the method and not const. The latter is typical where
the collection is sorted immediately before the loop.
In two cases (doc.cpp), replaced Q_FOREACH + delete with qDeleteAll.
In two cases (cppcodeparser.cpp), the range declaration is replaced
within the loop statement. These rewrites express the behavior clearer
than the original code.
In two cases (codeparser.cpp), use a range-based for instead of a while
loop where the condition is an iterator, for more expressive code.
Finally, use the auto keyword where appropriate and improve a few
variable names.
QDoc warning count and generated output is unchanged after this
refactoring.
Change-Id: I64f02d24dca373a3a41402d535382e2c526bb55e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
|
|
|
|
| |
Change-Id: I0d95efceff54a8b7f54ed5e79275f9de1a43b68b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Most of these have remained unchanged since 2015, so it seems it is
simply not needed. In any case, these lines of code are all contained in
the git history.
Change-Id: I1bda6bc0aad61d59ec2f83de31d29e17d5255b71
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
|