diff options
author | Luca Di Sera <luca.disera@qt.io> | 2022-11-30 09:47:16 +0100 |
---|---|---|
committer | Luca Di Sera <luca.disera@qt.io> | 2022-12-01 13:03:09 +0100 |
commit | 11c9f677a9880bb0456d7796dfd2518b1396add3 (patch) | |
tree | f7f46570011a3a1f4046adc2c8850ec454682a5a /src/qdoc/qmlcodemarker.cpp | |
parent | 098a43348425557449adfca88c89ea8d0e0433ca (diff) | |
download | qttools-11c9f677a9880bb0456d7796dfd2518b1396add3.tar.gz |
QDoc: Remove `Sections::KeysAndNodes`
As part of producing a documentation set, QDoc generates a series of
lists for certain documentable elements.
For example, it produces a list of all elements that compose a QML type.
Internally, QDoc uses a pair of co-dependent classes `Sections` and
`Sections`.
A `Section` acts as a container for certain `Node`s, the base class of
the internal representation that QDoc uses for documentable elements,
while `Sections` is the public facing interface for all `Section` that
QDoc uses, which are statically determined.
When a `Sections` is constructed, it categorizes the child of an
`Aggregate`, an internal representation for documentable elements that
are composed of multiple documentable elements, so that they can be
consumed to build the lists that QDoc has to generate.
For example, `Sections` is used to categorize the members of a C++
class, such as constructors, destructors, slots and so on, into
organized lists that are then used to produce the reference page of that
same class.
`Sections` and `Section` use a series of internal structures to organize
the elements that should be categorized.
For QML elements, it uses a series of nested structure that are
populated starting at a type.
First, a certain map-like structure is constructed, organizing the
various elements that compose a QML type while sorting them at the same
time based on certain criterias.
Then, the map-like structure is flattened into a similar one-dimensional
nested structure.
At the leaf of this nested structure is `KeysAndNodes`, a pair containing a
list of strings, the keys of the original map-like structure, and a list
of `Node`s, the values of the original map-like structure.
One level up from `KeysAndNodes` there is `ClassKeysNodes`, a pair
joining a `KeysAndNodes` to the internal representation of the "parent"
QML type they are related to, the "Class" in the name of the structure.
QDoc currently has a single usage site that uses this structure,
`HtmlGenerators::generateAllQmlMembersFile`, which produces an output
file listing all elements, inherited or not, that compose a QML type.
While `HtmlGenerators::generateAllQmlMembersFile` makes use of this
structure, it only uses the "Nodes" part of `KyesAndNodes`, making the
"Keys" part dead code.
Hence, `KeysAndNodes` was removed as unnecessary, flattening the
internal structure that `Sections`/`Section` uses by one level, such
that `ClassKeysNodes` is now a pair of that relates the internal
reprensation of a parent QML type directly to its children, with no
"keys" in-between.
`ClassKeysNodes` was renamed to `ClassNodes`, to represent the "lack" of
"keys" that derives from the flattening.
Usages of the type were modified to use the new name.
`Section::classKeysNodesList` was similarly renamed to
`Section::classNodesList`, for consistency, and so its usage sites.
`Section::m_classKeysNodesList`, the internal variable used to hold an
instance of `ClassKeysNodes` was renamed, similarly, to `m_classNodesList`.
Change-Id: I11697afb46544a3f9f925a5d239124093bbc46df
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/qmlcodemarker.cpp')
0 files changed, 0 insertions, 0 deletions